Fork me on GitHub
#xtdb
<
2022-12-09
>
Stas Makarov10:12:10

thank you for your feedback @tatut @taylor.jeremydavid! for now I probably go with 3 queries, as suggested by Tatu ( https://gist.github.com/jehaby/7d58955955566ea32e9d94f8667f38f3#file-xtdb-lucene-clj-L3-L50 ) it works quite well for expected size of the dataset although I’m not sure I understand why approach with single query runs 10 times slower ( https://gist.github.com/jehaby/7d58955955566ea32e9d94f8667f38f3#file-xtdb-lucene-clj-L52-L89 ) is it possible to achieve the same speed with single query? PS: I haven’t tested both queries thoroughly yet, so some bugs might be present. i’ve also be happy to get any suggestions for possible improvements of readability and performance.

blob_thumbs_up 1
refset10:12:12

it's hard to analyze exactly what's going on without access to the sample data, but I suspect there's some aspect that's making the rules fire multiple times (they execute as non-lazy subqueries) and therefore it would be repeatedly running the same lucene searches

refset11:12:54

you could try adding some debug clauses to the and legs to help figure things out, like: [(println "running client search") ?ignore][(nil? ?ignore)]

refset11:12:25

> is it possible to achieve the same speed with single query? you could fold those top-level queries into a single query as explicit subqueries. There's not a huge advantage to doing so (it doesn't get much easier to read), but it means you only have one single query.