P
P
Philip2016-01-30 23:35:41
Sphinx
Philip, 2016-01-30 23:35:41

Why are MATCHs slower than regular filters?

There is a big rt index. Here is a rough config example:

index sph_rt
{
  rt_attr_uint 	= id_group
  rt_field 	        = f_id_group
  rt_attr_uint 	= date
  rt_mem_limit         = 512M
  docinfo = extern
  morphology = none
  type = rt
}

There are more than 20,000,000 records.
At the same time, for some reason, a request of the form
SELECT count(*) FROM sph_rt WHERE (MATCH('@f_id_group 9')) GROUP BY `date` LIMIT 400;
runs 3 (!!!) times slower than this query:
SELECT count(*) FROM sph_rt WHERE id_group = 9 GROUP BY `date` LIMIT 400;

What could be the reason for this effect? Judging by the description, MATCH should work much faster, since the sphinx has to process fewer documents. And how can you speed up a selection of this type?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question