79673168

Date: 2025-06-20 09:51:42
Score: 4
Natty:
Report link

I’m facing a strange issue with PostgreSQL query performance. The same query runs in under 1 second during certain periods, but takes around 20 seconds at other times. However, the data volume and other parameters remain the same across both time periods.

If a vacuum has been performed on the table, I would expect consistent performance throughout the day. But in this case, the query runs in 1 second during one half of the day and 20 seconds during the other half.

How can this be handled? What could be the root cause of this behavior?

Reasons:
  • Blacklisted phrase (1): What could be
  • Long answer (-0.5):
  • No code block (0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Suruthi Sundararajan