Include index flag(s) to enable non-standard index walks in queries #75

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

We have a few non-standard (opt-in) indexes defined: AVET and VAET for looking up :db/index true and :db.type/ref attributes, respectively. The indexes are defined with flags, like:

;; Opt-in index: only if a has :db/index true.
"CREATE UNIQUE INDEX idx_datoms_avet ON datoms (a, value_type_tag, v, e)
 WHERE index_avet IS NOT 0"

that means we need to include index_avet in the query (in some way) to enable SQLite to walk that index. Further, we may need to tweak the index definition, since SQLite more or less uses queries only if they "directly match" the query syntax: https://www.sqlite.org/partialindex.html.

We have a few non-standard (opt-in) indexes defined: AVET and VAET for looking up `:db/index true` and `:db.type/ref` attributes, respectively. The indexes are defined with flags, like: ``` clojure ;; Opt-in index: only if a has :db/index true. "CREATE UNIQUE INDEX idx_datoms_avet ON datoms (a, value_type_tag, v, e) WHERE index_avet IS NOT 0" ``` that means we need to include `index_avet` in the query (in some way) to enable SQLite to walk that index. Further, we may need to tweak the index definition, since SQLite more or less uses queries only if they "directly match" the query syntax: https://www.sqlite.org/partialindex.html.
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#75
No description provided.