Open starinacool opened 2 months ago
I can reproduce the issue in the latest dev version on dev2
(in /home/snikolaev/issue-1641
):
snikolaev@dev2:~/issue-1641$ rm /tmp/1; for n in `seq 1 1000`; do echo "select id FROM listing2 WHERE match(' @n ( (5 марок unc) )');" >> /tmp/1; done; time mysql -P9315 -h0 < /tmp/1 > /dev/null
real 0m28.920s
user 0m0.017s
sys 0m0.065s
snikolaev@dev2:~/issue-1641$ rm /tmp/2; for n in `seq 1 1000`; do echo "select id FROM listing2 WHERE match(' @n ( (unc 5 марок) )');" >> /tmp/2; done; time mysql -P9315 -h0 < /tmp/2 > /dev/null
real 0m13.169s
user 0m0.047s
sys 0m0.036s
Query details:
Bug Description:
Consider the query:
Meta Result:
And this:
Meta:
The difference in queries is only the order of match parameters. But first query is 10x slower then the second and hits the max_predicted_time limiter.
The solution I see: Optimiser should sort keywords in "AND" match blocks in order of number of docs in the index first. Then start searching.
It looks like it is the same issue as in 1641.
Manticore Search Version:
6.3.0
Operating System Version:
Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
Have you tried the latest development version?
None
Internal Checklist:
To be completed by the assignee. Check off tasks that have been completed or are not applicable.