-
-
Notifications
You must be signed in to change notification settings - Fork 597
Adding MVA field in query extremely slowing it down #3381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@cappadaan what's the schema of the table and what Manticore version are you using? |
I see it's 9.3.2 |
Can you please also provide |
This is a realtime index. Relevant config values:
Query SHOW META SHOW TABLE index SETTINGS SHOW TABLE index INDEXES These are only the relevant for the query. The table itself has over 40 columns. Let me know if you need any other info. |
The format of the MVA in the field does not mather: AND or AND Both take forever, sometimes up to 2 minutes. |
We can try to reproduce the issue locally if we know these three things. |
|
@sanikolaev Any news on this issue, have you been able to reproduce it? |
@cappadaan I can't reproduce it with:
Here's the result:
|
@cappadaan can you try the same on your end? |
select count(*) from index where date >= 1700000000 and date <= 1706500000;4702408 results select count(*) from index where date >= 1700000000 and date <= 1706500000 and ANY(m) IN (3,5) 509670 results show meta total 1 |
Can it be hardware related, maybe some limits are hit? |
@cappadaan what's your version of AlmaLinux? |
9.5 |
hardware VPS, Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz, 20G RAM limits.conf manticore soft memlock unlimited manticore config max_filter_values = 100000 select count(*) from test where date >= 1700000000 and date <= 1706500000 and ANY(m) IN (3,5); show meta; total 1 show table test status table_type rt |
Why do you have so many chunks? Combined with Anyway, let's focus on the synthetic case, which also shows a big difference between your server and even the weakest Hetzner VPS. Can you try again with the default Manticore configuration this time?
|
I think the chunks is the result of our reindex method. We use this method:
Maybe if we set the rt_mem_limit to eg. '5G' and reindex again, the chunks will be much less? Is there a prefered chunk bandwidth? I cannot find anything about it in the documentation. |
The number of disk chunks isn't related to the batch size. There could be two reasons why there are too many chunks:
Please share your |
auto_optimize is on. I uploaded the log to your S3 storage under this ticket issue id. There is also a crash dump in the log, maybe related. |
I see a lot of "... optimized progressive chunk(s) 57 (left 56) ..." in the log for all tables. It looks like you have 28 cores, which sets the default
|
I ran the load command and the query.
I also tried this on my own index
|
So with the same Manticore version and config in your case, it took 3960 ms, while on the weakest VPS it only took 569 ms with the same OS, and just 32 ms on a regular modern MacBook Pro. It looks like there might be something wrong with your server @cappadaan . You might want to check the CPU performance using some benchmarking tools. I’ve had an issue in the past where the CPU was performing poorly because it was overheating and throttling. That might be what's happening in your case too. Check the CPU temperature. BTW when Manticore is busy doing this:
what's the CPU load according to dstat/vmstat? |
You maybe right, we are struggling with manticore on this vps for a while now. While running the query: [root@manticore maintenance]# vmstat iostat It looks like there is not much happening at all. But this query caused a fatal crash now: [Tue May 27 07:21:56.106 2025] [8251] [BUDDY] [X] <Thrown: QueryProcessor:256> <Logged: EventHandler:73> <[68356814140f33.58265631] processing error> Failed to handle query: select count(*) from index where date>= 1700000000 and date <= 1706500000 and ANY(m) IN (3,5) |
If the crash has same crash steck leads into join sorter - it could be better to create separate issue and upload data (config, query, indexes) that reproduces that crash here locally. |
Bug Description:
Adding a MVA field as SQL filter causing the query to slow down extremely. Any other type of field is not slowing the query down.
Queries to show the effect:
Query without MVA field
SELECT
COUNT(*) AS doc_count
FROM
index
WHERE
date >= 1739314800
AND
date <= 1747087199
=> 5821426 results - 501ms
Query with INT field
SELECT
COUNT(*) AS doc_count
FROM
index
WHERE
date >= 1739314800
AND
date <= 1747087199
AND
INT_field = 1
=> 5232640 results - 900ms
Query with MVA field
SELECT
COUNT(*) AS doc_count
FROM
index
WHERE
date >= 1739314800
AND
date <= 1747087199
AND
MVA_field = 5
=> 716972 results - 10,1sec
Manticore Search Version:
9.3.2
Operating System Version:
AlmaLinux
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.
The text was updated successfully, but these errors were encountered: