Re: So, is COUNT(*) fast now?

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: So, is COUNT(*) fast now?
Date: 2011-10-23 23:01:01
Message-ID: CAMkU=1wp3FskYnCjks4Sj-WZ6wBqHaSTr-0EF6-EDF1LyTDQ-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 21, 2011 at 12:52 PM, Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-10-23 23:26:57 Re: EXECUTE tab completion
Previous Message Jeff Janes 2011-10-23 22:41:05 Index only scans and visibilitymap.c