Re: Slow count(*) again... - Mailing list pgsql-performance

From Vitalii Tymchyshyn
Subject Re: Slow count(*) again...
Date
Msg-id 4CB58CF0.4020601@gmail.com
Whole thread Raw
In response to Re: Slow count(*) again...  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-performance
12.10.10 14:44, Craig Ringer написав(ла):
>
>> in the case where you are doing a count(*) where query and the where is
>> on an indexed column, could the search just look at the index + the
>> visibility mapping rather than doing an sequential search through the
>> table?
>
> Nope, because the visibility map, which is IIRC only one bit per page,
> doesn't record how many tuples there are on the page, or enough
> information about them to determine how many of them are visible to
> the current transaction*.
I'd say it can tell you that your may not recheck given tuple, can't it?
You still have to count all index tuples and recheck the ones that are
uncertain. Does it work in this way? This can help a lot for wide tuples
in table, but with narrow index and mostly read-only data.

Best regards, Vitalii Tymchyshyn

pgsql-performance by date:

Previous
From: Neil Whelchel
Date:
Subject: Re: Slow count(*) again...
Next
From: Vitalii Tymchyshyn
Date:
Subject: Re: Slow count(*) again...