Multi-queries Not optomizing

I’d like to use the sub query optimization discussed under Common subtree optimization in the Manticore documentation on Multi-queries, but I can’t seem to get any query to use a subtree unless they are identical.

I’ve tried setting subtree_hits_cache and subtree_docs_cache to 64MB, but that doesn’t seem to help. Are there any other required settings, or something else I’m missing? Thanks!

Example queries through PHP PDO query:

conn 79 real 0.008 wall 0.006 found 59863 */ SELECT * FROM addresses_en_us WHERE MATCH(‘@(city) braunfels’) LIMIT 0,1;
conn 79 real 0.008 wall 0.012 found 59863 */ SELECT * FROM addresses_en_us WHERE MATCH(‘@(city) new braunfels’) LIMIT 0,1;

conn 80 real 0.005 wall 0.005 x2 found 59863 */ SELECT * FROM addresses_en_us WHERE MATCH(‘@(city) new braunfels’) LIMIT 0,1;
conn 80 real 0.005 wall 0.005 x2 found 59863 */ SELECT * FROM addresses_en_us WHERE MATCH(‘@(city) new braunfels’) LIMIT 0,1;

could you try your test without field specifier ?

Behavior was the same without the field specifier when I tested yesterday.

I think I might have figured out the issue though. It seems like the subtree optimization only works when sending 3 or more queries that are different. Not sure why it wouldn’t work for two, and overall it seems a bit random when it doesn’t work, but it should be ok for my use.

you could also post reproducible example at the github ticket to get informed on issue fixing progress

Thanks, I’ll put something simple together and submit a ticket. Wasn’t sure if I was doing something wrong or missing a setting.