Well, I've managed to track down the cause of improper plans.
Due to the data distribution n_distinct had been estimated way too low.
I've manually set it to be 195300 instead of 15500 (with stats_target=200):
select tablename,attname,null_frac,avg_width,n_distinct,correlation
from pg_stats
whe
Greetings.
I have a small monitoring query on the following tables:
select relname,relpages,reltuples::numeric(12) from pg_class where relname
in ('meta_version','account') order by 1;
relname| relpages | reltuples
--+--+---
account | 3235 |197723