HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Where can I see the exact row count of a table in pgAdmin III?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
exactpgadmincanthewhereseeiiicountrowtable

Problem

Where can I see the exact row count of a table in pgAdmin III?

I know where to find the approximate row count:

I am also aware I can SELECT COUNT(*) FROM my_table. But I want to know whether the exact row count can be found somewhere in pgAdmin III's GUI, in the same way we can query the top 100 rows.

Solution

Two lines below the estimate you highlighted we can see:

Rows (counted)  not counted


Right-click and choose Count from the context-menu to get the current count right there. Be aware that the count is only accurate in the moment it is taken.

pgAdmin does not count rows in big tables (because that can be expensive) unless it's told to do so. There is a setting in the Options:

Count rows if estimated less than [2000]


Replace the default 2000 if you want a different limit. Details in the manual here:

http://www.pgadmin.org/docs/1.20/options-browser.html

Code Snippets

Rows (counted)  not counted
Count rows if estimated less than [2000]

Context

StackExchange Database Administrators Q#118945, answer score: 8

Revisions (0)

No revisions yet.