Ampersand
Ampersand copied to clipboard
Don't store scalar atoms in own concept table if not needed
Problem
The following screenshot shows that some relations, e.g. datetime
, have excessive amounts of instances:
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
.