Re: So, is COUNT(*) fast now? - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: So, is COUNT(*) fast now?
Date
Msg-id CAMkU=1wp3FskYnCjks4Sj-WZ6wBqHaSTr-0EF6-EDF1LyTDQ-w@mail.gmail.com
Whole thread Raw
In response to Re: So, is COUNT(*) fast now?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: So, is COUNT(*) fast now?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Oct 21, 2011 at 12:52 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> Also, this line is kind of expensive:
>
>        if (!visibilitymap_test(scandesc->heapRelation,
>                                ItemPointerGetBlockNumber(tid),
>                                &node->ioss_VMBuffer))
>
> Around 2%.  But I don't see any way to avoid that, or even make it cheaper.

Could we cache by ItemPointerGetBlockNumber(tid) the results of those
tests, for groups of tids on the same index page?

How useful this would be would depend on how well-clustered the table
and index are.


Cheers,

Jeff


pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Index only scans and visibilitymap.c
Next
From: Tom Lane
Date:
Subject: Re: EXECUTE tab completion