[query] Attribute derivation #124

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

Consider a query like

[:find ?x :where [?x ?a 15.5]]

What this query means, and the results it can produce, depend very much on the schema.

If the schema contains no attributes with :db/valueType :db.type/double (we don't support float), then we know at algebrizing time that this query can return no results.

If the schema contains only one double attribute, then we know that ?a must be bound to that attribute if the query is to return results, and we can act as if ?a is a constant. This can allow us to generate a more efficient query plan.

If the schema contains several attributes that could match, then we can at least constrain the solution space.

This ticket tracks doing that when the algebrizer is a little more complete (after #243).

Consider a query like ``` [:find ?x :where [?x ?a 15.5]] ``` What this query means, and the results it can produce, depend very much on the schema. If the schema contains _no_ attributes with `:db/valueType :db.type/double` (we don't support `float`), then we know _at algebrizing time_ that this query can return no results. If the schema contains only one `double` attribute, then we know that `?a` must be bound to that attribute if the query is to return results, and we can act as if `?a` is a constant. This can allow us to generate a more efficient query plan. If the schema contains several attributes that could match, then we can at least constrain the solution space. This ticket tracks doing that when the algebrizer is a little more complete (after #243).
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#124
No description provided.