Thread: yet another stupid question (index coverage)

yet another stupid question (index coverage)

From
Alex Pilosov
Date:
Postgresql doesn't support index coverage, does it?

Some stuff that really flied on [cough] other database seems very slow.
Explain shows it is using index scan, however, it looks like database is
fetching blocks from all over the disk, when all information necessary is
already in index.

For those unfamiliar with index coverage, it is used to avoid access to
the main table when all necessary information can be found in index
itself. (Example: select count(*) where condition, assume table has
1M rows, only 10k of them will be selected. Assume that page in main table
covers 50 records and page in index covers 500 records. Total pages
accessed without index coverage: ~10k, with coverage: ~20).

Any chance of this feature getting on the wish list? :)

I thought about coding that feature myself, but it seems to be quite
involved: Apparently TupleTableSlot as it is _must_ have all information
from the row...

-alex


Re: yet another stupid question (index coverage)

From
Peter Eisentraut
Date:
Alex Pilosov writes:

> Explain shows it is using index scan, however, it looks like database is
> fetching blocks from all over the disk, when all information necessary is
> already in index.

All except the all-important piece of information whether the tuple is
visible to the current transaction.  That you need to fetch from the main
table.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter