Fork me on GitHub
#xtdb
<
2022-11-23
>
tatut11:11:09

any tuning tips for for lucene (`text-search` by attribute) query performance, I have some slow queries, but the lucene search itself is very fast and returns only a handful of results (the other part of the query has potentially huge set of data)

👀 1
tatut11:11:16

it seems the planner might be confused… If I only search for the things returned by the lucene search and traverse the other stuff by reverse pull patterns, I can get the same data much faster.

tatut11:11:50

as I’m building the query dynamically this is tricky

tatut11:11:46

I could just do a separate lucene search and pass the found ids as an :in parameter to the other query to workaround this

refset12:11:10

Hey @U11SJ6Q0K yes this sounds like the planner getting ~confused. The other workaround is to push the lucene search clause into a subquery, which forces the desired join order (i.e. to still do everything in one big query)

tatut12:11:47

there was another seeming problem with a rule invocation that was confusing the planner, apparently [(str something ":") ?something-else] doesn’t understand ?something-else is static, and it didn’t work with >= index

tatut12:11:18

but I solved this case by doing a separate query and just passing a set of indexes that constrain one term in the larger query

👍 1