Usually postgresql performance issue is because of statistics data out of date. The planner may think one table is small but actually its huge.

Diagnosis

For example:

Solution

TODO

To maintain a health database, should put slow query alert there, and setup auto vacuum.

Leave a Reply

Your email address will not be published. Required fields are marked *