nethesis / dev

Nethesis issue tracker
http://www.nethesis.it
4 stars 1 forks source link

Slow report miner query take too much time #6154

Closed Stell0 closed 2 years ago

Stell0 commented 2 years ago

tracing queue miner queries, there is one that take a lot of time and in machines with a lot of calls can slow down the task so much that they keep going even the morning after when the customer started working.

The query is

UPDATE report_queue SET cid = (SELECT cid FROM report_queue_callers WHERE report_queue_callers.timestamp_in = report_queue.timestamp_in LIMIT 1) WHERE cid IS NULL AND timestamp_in > $start_ts

And on my test machine takes ~3 hours

Steps to reproduce

Expected behavior

This query is quite simple and only updates the calls of the current day, shouldn't take too much time

Actual behavior

On my test machine, this query takes more than 3 hours

nethbot commented 2 years ago

in 7.9.2009/nethesis-testing:

nethbot commented 2 years ago

in 7.9.2009/nethesis-updates: