Statistics targets
It should be obvious from the previous section that the number of buckets used to hold common values or histogram samples significantly influences how accurate query row estimates will be. The number of them ANALYZE aims to collect is called its target. The postgresql.conf parameter default_statistics_target sets the standard target for tables in each database. The default target was 10 up to PostgreSQL 8.3, increasing to 100 in 8.4. This means that the 8.4 version has significantly more statistics to work with by default, which normally results in better queries. The cost for that is slightly worse query planning time as well as significantly longer ANALYZE processing (that second part not being something most people care ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access