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

From Robert Haas
Subject Re: So, is COUNT(*) fast now?
Date
Msg-id CA+Tgmoaj03w5REVnpwwnhwNEaZFCYDZvMsu3yFAk=-b1vzomkQ@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?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: So, is COUNT(*) fast now?  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Fri, Oct 21, 2011 at 3:07 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> [ oprofile results ]

*grovels through the line-by-line results*

Hmm, I guess there is a bit of a hotspot in StoreIndexTuple, which is
probably being folded into IndexOnlyNext in the per-function timings:
   ExecClearTuple(slot);   for (i = 0; i < nindexatts; i++)       values[i] = index_getattr(itup, i + 1, itupdesc,
&isnull[i]);  ExecStoreVirtualTuple(slot);
 

If I'm reading these results right, that section is about 3% of the
total number of samples.

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.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: So, is COUNT(*) fast now?
Next
From: Tom Lane
Date:
Subject: Re: So, is COUNT(*) fast now?