Hacker News new | ask | show | jobs
by adeel_siddiqui 1743 days ago
set `enable_seqscan` = 'off' or set local `enable_seqscan` = 'off'. This will force the pg query planner to use indexes. Experiment with it until you figure out why your query performance deteriorates. Maybe you are doing a lot of updates/deletes? Increase the statistics sampling size? Autovacuum more frequently?
1 comments

Could one disable statistics completely? Personally, I'd prefer to specify the execution plan manually.