[query] Exploit AVET and VAET indexes in query engine #274
Labels
No labels
A-build
A-cli
A-core
A-design
A-edn
A-ffi
A-query
A-sdk
A-sdk-android
A-sdk-ios
A-sync
A-transact
A-views
A-vocab
P-Android
P-desktop
P-iOS
bug
correctness
dependencies
dev-ergonomics
discussion
documentation
duplicate
enhancement
enquiry
good first bug
good first issue
help wanted
hygiene
in progress
invalid
question
ready
size
speed
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: greg/mentat#274
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The SQLite schema defining the datoms table (and the indexes upon it) specifies the AVET and VAET indexes as partial: see https://github.com/mozilla/mentat/blob/master/db/src/db.rs#L180-L181 and https://github.com/mozilla/mentat/blob/master/db/src/db.rs#L183-185. The only way the SQLite query engine can exploit those indexes is if the produced SQL constrains the query, in some way to have the relevant
index_{avet,vaet}
columns set -- and we don't do that right now.There's a similar but technically distinct case that we do support. The
:db/fulltext true
case is managed asindex_fulltext
and as a separate table. If we wanted to, we could manage the partial indexes as separate tables manually. It's not clear what is the more desirable SQLite schema.