Search Postgresql Archives

Re: Indices for select count(*)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 23, 2005 at 11:04:50AM -0500, Tom Lane wrote:
> It's not that easy --- in the MVCC world there simply isn't a unique
> count that is the right answer for every observer.  But the idea of
> packaging a count(*) mechanism as an index type seems like it might be
> a good one.  I don't think the planner objection need be taken too
> seriously: we already have a good big wart in there for recognizing
> MIN/MAX indexability, and this sort of transformation would fit pretty
> naturally with what's already done in planagg.c.

AFAICS two big problems with using an index type:

1. The index isn't told when the tuple is deleted.
2. The server expects to be able to lookup an index.

Other than that...

-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpmoot2r7WJS.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux