Your query exceeded the maximum run time and was stopped. Try modifying your query to improve the performance or contact your RT admin

I have upgraded from 5.0.5 to 5.0.7 and I get ‘Your query exceeded the maximum run time and was stopped. Try modifying your query to improve the performance or contact your RT admin.’ also at login time.

Notes:

  1. I did run make upgrade-database
  2. sessions are cleaned up
  3. /var/lib/mysql is just 4GB
  4. I have enabled mysql slow query log, but I can’t see anything there
  5. machine has 0 load
  6. I get the warning at login time, while I don’t see slowness.

How to debug the issue to understand where/why this warning come from?

I see that comes from lib/RT/System.pm and lib/RT/Handle.pm but I don’t know perl.