Re: Indices for select count(*)? - Mailing list pgsql-general

From Tom Lane
Subject Re: Indices for select count(*)?
Date
Msg-id 21985.1135363109@sss.pgh.pa.us
Whole thread Raw
In response to Re: Indices for select count(*)?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout <kleptog@svana.org> writes:
> AFAICS two big problems with using an index type:

> 1. The index isn't told when the tuple is deleted.

Hm, good point ... we could make it do so but for ordinary deletes it'd
be a waste of cycles to open indexes at all.

> 2. The server expects to be able to lookup an index.

Only if there is a WHERE operator that matches the index's opclass.
This hypothetical index type would probably have one dummy opclass
containing no operators.

            regards, tom lane

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Indices for select count(*)?
Next
From: Michael Adler
Date:
Subject: Re: HINT: Perhaps out of disk space?