3 ms·
You can change the statistics target, see https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET https://www.postgresql
by fabian2k 6y ago
You can change the statistics target, see https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-DEFAULT-STATISTICS-TARGET https://www.postgresql.org/docs/current/runtime-config-query...
You can also create more advanced statistics over multiple columns: https://www.postgresql.org/docs/current/planner-stats.html https://www.postgresql.org/docs/current/planner-stats.html
But if your statistics are bad, it will certainly mess up some of your query plans.
- jandrewrogers 6y agoYes, everyone knows these things, it does not address the issue. Due to its architecture, there are difficult to change internal limits on how PostgreSQL samples the data. Under some conditions, it is not possible for the sampling mechanics to build a representative model -- the actual statistics used for query planning will be quasi-random. One of the ways this manifests is that every time you rebuild the statistics you get a completely different statistical model even if the data has barely changed.