On Fri, Oct 21, 2011 at 12:07 PM, Robert Haas <robertmh...@gmail.com> wrote:
> On Fri, Oct 21, 2011 at 2:33 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:
>>> I think HeapTupleSatisfiesMVCC is probably being skipped anyway in
>>> this case, since all the heap pages should be PD_ALL_VISIBLE.
>> Proves my point ;-) ... you're comparing a code path that's been beat on
>> for *years* with one that just got written.
> I know.  I wrote a chunk of it.  :-)  My point is just that it'd be
> nice to make it better.
> Anyhow, here's the scoop.  On my desktop machine running F14, running
> SELECT sum(1) FROM pgbench_accounts in a tight loop, 60 s worth of
> oprofile data:
> 176830   13.0801  postgres                 postgres                 
> ExecProject

Hi Robert,

count(*) and sum(1) do different things internally, and in my hands
sum(1) is ~10% slower.

I don't know how to dump the output of ExecBuildProjectionInfo into a
human readable form, so I don't know the basis of the difference.  But
I wonder if using count(*) would lower the weight of the ExecProject



Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to