I have a table that has 44 columns and slightly less than 2000 rows. Also, the data are all text or integers. Texts don't go longer than a few characters. Table size is about 1900kb. All my other tables' planning time is less than 10ms.
explain analyze select * from my_table_1 where my_table_1_primary_key=1
query as simple as this yields planning time: 2000~6000ms execution time: 0.6~2ms
My suspect for the problem is
- pg_catalog.pg_statistic being 588MB for unknown reason. => the grand sum of all my tables is less than 10 MB of data.
- I do very frequent update for
my_table_1. About 50 updates every 2 minutes, each update updating 5 columns of corresponding single rows.
- I have 6 unique columns which auto generates 7 indexes in total. (including single column primary key)
Any ideas on my situation?