Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
pg_class.reltuples VS pg_stat_all_tables.n_live_tup for estimation of table - Mailing list pgsql-general
From
William Dunn
Subject
pg_class.reltuples VS pg_stat_all_tables.n_live_tup for estimation of table
Date
June 17, 2015
22:14:57
Msg-id
CAEva=V=bNb6rBZH_AuXQ19pFXqAoyKdRjyFKeR93ckdkXQdgsQ@mail.gmail.com
Whole thread
Raw
Responses
Re: pg_class.reltuples VS pg_stat_all_tables.n_live_tup for estimation of table
List
pgsql-general
Tree view
Hello,
Does anyone which is a more accurate estimate of a table's live rows: pg_class.reltuples (
http://www.postgresql.org/docs/current/static/catalog-pg-class.html
) OR pg_stat_all_tables.n_live_tup (
http://www.postgresql.org/docs/current/static/monitoring-stats.html#PG-STAT-ALL-TABLES-VIEW
)? In my test database their values are not the same.
Is pg_class.reltuples an estimation of live tuples only, or is it of all tuples (both live and dead)? I would guess it's live only but that is a guess
In the database I am testing:
pg_class.reltuples <> pg_stat_all_tables.n_live_tup
pg_class.reltuples <> (pg_stat_all_tables.n_live_tup + pg_stat_all_tables.n_dead_tup)
I understand that pg_stat_all_tables is probably the more expensive view to query but I am already querying both so I only care which is more accurate.
Thanks!
Will
Will J. Dunn
willjdunn.com
pgsql-general
by date:
Previous
From:
Jony Cohen
Date:
17 June 2015, 22:10:53
Subject:
Index Advice in PG
Next
From:
Tom Lane
Date:
17 June 2015, 22:48:43
Subject:
Re: pg_class.reltuples VS pg_stat_all_tables.n_live_tup for estimation of table
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies