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

From Tom Lane
Subject Re: So, is COUNT(*) fast now?
Date
Msg-id 16683.1319318120@sss.pgh.pa.us
Whole thread Raw
In response to Re: So, is COUNT(*) fast now?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Oct 21, 2011 at 10:57 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
>> If count(*) could cause the index-only scan to happen in physical
>> order of the index, rather than logical order, that might be a big
>> win. �Both for all in memory and for not-all-in-memory.

> That's an interesting point.  I sort of assumed that would only help
> for not-all-in-memory, but maybe not.  The trouble is that I think
> there are some problematic concurrency issues there.

Yeah.  We managed to make physical-order scanning work for VACUUM
because it's okay if VACUUM sometimes sees the same index tuple twice;
it'll just make the same decision about (not) deleting it.  That will
not fly for regular querying.
        regards, tom lane


pgsql-hackers by date:

Previous
From: karavelov@mail.bg
Date:
Subject: Re: So, is COUNT(*) fast now?
Next
From: Tom Lane
Date:
Subject: Re: database file encryption.