3 ms·
reminds me of helping a friend at work years ago (the halcyon MySQL 3.23 days) they had a query that ran every 5 minutes, but on non-trivial data sets (network
by warrenm 5y ago
reminds me of helping a friend at work years ago (the halcyon MySQL 3.23 days)
they had a query that ran every 5 minutes, but on non-trivial data sets (network monitoring data for more than ~200 devices on a network), the query would take more than 5 minutes to run ... throwing hardware at the problem didn't help noticeably (double the CPU speed? run time would drop by ~5%)
converting their query from OR form to IN() cut runtime by 90%
All because of how the SQL engine thought it should run comparisons (MySQL, at the time, at least, used the IN() as functionally equivalent to a jump table, whereas the OR format was treated as a series of it...then...elseif...else statements)