Re: count(*) slow on large tables
Rod Taylor <rbt@rbt.ca>
From: Rod Taylor <rbt@rbt.ca>
To: Josh Berkus <josh@agliodbs.com>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>, Tom Lane <tgl@sss.pgh.pa.us>, Christopher Browne <cbbrowne@libertyrms.info>, Postgresql Performance <pgsql-performance@postgresql.org>
Date: 2003-10-05T19:11:50Z
Lists: pgsql-hackers, pgsql-performance
> And for those GUIs, wouldn't it be 97% as good to run an ANALYZE and give the > approximate record counts for large tables? Interfaces which run a COUNT(*) like that are broken by design. They fail to consider the table may really be a view which of course could not be cached with results like that and may take days to load a full result set (we had some pretty large views in an old billing system).