3 ms·
I always increase the seq scan cost, but another thing that helped me more was updating the table statistics. In that way you can make the planner better aware
by olavgg 9y ago
I always increase the seq scan cost, but another thing that helped me more was updating the table statistics. In that way you can make the planner better aware of your indexes.
In my case I increased STATISTICS to 5000 and the planner immediately start using the index instead of full table scan.
https://blog.pgaddict.com/posts/common-issues-with-planner-statistics https://blog.pgaddict.com/posts/common-issues-with-planner-s...