

These statistics collect information about count accesses to tables and indexes in both disk block and individual row terms. These types of stats are collected by the statistics collector. In addition to data distribution and extended statistics, there are monitoring statistics as well. Seq Scan on ext_stats (cost=47.65 rows=1017 width=8) (actual time=0.076.615.219 rows=1000 loops=1)Īs you see, estimated rows (1,017) is very close to the actual number.Īll the queries with filters on both columns will have much better estimates using extended statistics.

Postgres=> explain analyze select * from ext_stats where a=1 and b=0 INFO: "ext_stats": scanned 30000 of 44248 pages, containing 6779952 live rows and 0 dead rows 30000 rows in sample, 9999977 estimated total rows Postgres=> create statistics s_ext_depend(dependencies) on a,b from ext_stats
#AMAZON AWS POSTGRESQL 10 HOW TO#
The purpose of this post is to explain the types of statistics in PostgreSQL and how to read and understand them.

The query planner uses the statistical data to generate efficient run plans for queries. AWS provides two managed PostgreSQL options: Amazon Relational Database Service (Amazon RDS) for PostgreSQL and Amazon Aurora PostgreSQL-Compatible Edition.ĭatabase statistics play a key role in improving the performance of the database. PostgreSQL has become the preferred open-source relational database for many enterprise developers and startups, and powers leading business and mobile applications.
