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 ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.