Answer the question
In order to leave comments, you need to log in
How to achieve good performance in Sphinx?
Good afternoon!
There is a mechanism that uses the index in sphinx for non-full text searches. That is, in fact it is just a table with a certain number of simple fields (only int).
A fairly simple query with an elementary filter on this plate gave a rather weak result, which caused some surprise. In the process of finding a problem, the query was simplified to a state where there is nowhere to simplify it further and still the query execution time is fantastic:
select user_id from index limit 1;
/* Affected rows: 0 Найденные строки: 1 Предупреждения: 0 Длительность 1 query: 0,110 sec. */
Answer the question
In order to leave comments, you need to log in
I can assume that there is a fullscan of the index, because sphinx, when filtering by attributes, without searching, will look through the entire index, calculate all the values that fall under the condition, sort, impose limits and return the result. Because after each request, you can get meta information. Thanks to this mechanism, it is possible to display pagination without an additional count (*) request. And yes, it seems to me that you are using the tool for the wrong case. If you still really need to, you have to put up with it.
well, you are using the tool for other purposes, such things will work with the correct indexes in normal mysql
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question