Re: Much Ado About COUNT(*)
Jonah H. Harris <jharris@tvi.edu>
From: "Jonah H. Harris" <jharris@tvi.edu>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-hackers@postgresql.org
Date: 2005-01-12T21:48:33Z
Lists: pgsql-hackers
Bruno Wolff III wrote: >On Wed, Jan 12, 2005 at 14:09:07 -0700, > "Jonah H. Harris" <jharris@tvi.edu> wrote: > >Please keep stuff posted to the list so that other people can contribute >and learn from the discussion unless there is a particular reason to >limited who is involved in the discussion. > > > not a problem. >Perhaps you think that the count is somehow saved in the index so that >you don't have to scan through the whole index to get the number of >rows in a table? That isn't the case, but is what creating a materialized >view would effectively do for you. > > I understand that the count is not stored in the index. I am saying that it may be faster to generate the count off the keys in the index. I shouldn't have titled this message COUNT(*) as that isn't the only thing I'm trying to accomplish.