Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

Don't store scalar atoms in own concept table if not needed

Open stefjoosten opened this issue 3 years ago • 6 comments

Problem

The following screenshot shows that some relations, e.g. datetime, have excessive amounts of instances: image From a practical point of view, there is no reason to keep such data stored in the database. It is unsure whether this leads to performance problems, which we won't analyze in the current issue. This issue is weakly related to issue #560.

Analysis

At the moment all atoms are stored in a concept list. For atoms like DATETIME that are stored in the concept table DateTime, this is clearly excessive. So not every concept needs a concept list in the database. But which? Of which concepts can we prove at compile-time that they don't need a concept table? (sidestep: The Haskell function sqlConceptPlug :: FSpec -> A_Concept -> PlugSQL gives us the concept table in the compiler.)

So when is a concept table used? For this, we have to analyze terms, which are the only source of using concept tables. If a term contains a subtermI[C], the compiler generates a query that uses the concept table of C.

Proposed Solution

Impact

stefjoosten avatar Mar 13 '21 08:03 stefjoosten