Fork me on GitHub
#xtdb
<
2022-12-27
>
phill17:12:09

I was messing around with the datalog and Pull queries to retrieve facts about linked objects and was surprised that a pure datalog-triples query, with a particulate "find" part and a "where" part that implied the joins and filtered the results, took 10 times as long to run as an equivalent query with a smaller "where" part, merely to identify some documents, and a "pull" part that traversed all the joins, followed by my own "filter" call to weed out some undesirable results. Can I influence efficiency by ordering or hinting the datalog clauses?

FiVo11:12:05

This is currently not supported but it was discussed before that adding the option of the user specifying the variable ordering might be a good addition.

FiVo11:12:07

You are probably currently running into a case where the engine makes a bad choice when deciding on a variable ordering. Deciding on join order is a difficult topic.

tatut13:12:05

I’ve often longed for a “mode” that would work like datomic (no query planner, just use the order as specified in :where clause)

tatut13:12:20

had to break up queries to run separately as the planner gets confused