[query] Include index flags in algebrized query #137

Open
opened 2020-08-06 16:55:32 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:55:32 +00:00 (Migrated from github.com)

This ticket is vague because the Clojure implementation doesn't do this, I didn't see a framework for maintaining this information in the initial algebrizer landing (see #243), and I'm not sure what it'll entail.

The general problem is that Mentat maintains certain SQLite indices, namely the AVET and VAET indices, based on per-row flags in the SQL store. What that means is that certain query types, including ones like

... :where [?e :concrete-attribute concrete-value] ...

will be efficient only if the generated SQL constrains the index flags (here, WHERE index_avet = 1) as appropriate.

In the DataScript implementation, the form of the pattern itself was used to choose which index to walk at query time. This ticket tracks making sure that we do the right thing in the algebrizer.

This ticket is vague because the Clojure implementation doesn't do this, I didn't see a framework for maintaining this information in the initial algebrizer landing (see #243), and I'm not sure what it'll entail. The general problem is that Mentat maintains certain SQLite indices, namely the AVET and VAET indices, based on per-row flags in the SQL store. What that means is that certain query types, including ones like ```edn ... :where [?e :concrete-attribute concrete-value] ... ``` will be efficient only if the generated SQL constrains the index flags (here, `WHERE index_avet = 1`) as appropriate. In the DataScript implementation, the form of the pattern itself was used to choose which index to walk at query time. This ticket tracks making sure that we do the right thing in the algebrizer.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#137
No description provided.