Re: Another idea for index-only scans

From: Decibel! <decibel(at)decibel(dot)org>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Another idea for index-only scans
Date: 2007-08-16 03:52:21
Message-ID: A382EF6C-B0E2-4E90-941B-F215D9F52C2F@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Aug 15, 2007, at 1:54 PM, Gregory Stark wrote:
>>> A third idea would be for a heap scan to check if all rows are
>>> visible
>>> and if so set a per-table flag which can be checked by index
>>> scans.
>>> Any change to the table would have to clear the flag. To detect
>>> changes during the heap scan a counter could be set at the
>>> start and
>>> checked at the end --- if it is the same, the table has not been
>>> modified --- any table change would increment the counter.
>
> I think I would prefer to address this in the same infrastructure
> as the
> dead-space-map. That way you're not dependent on having no updates
> happening
> on the table at all. Any tuples on pages which contain no in-doubt
> tuples
> could have their visibility check skipped but when you come across
> a tuple on
> a page which has been modified since the last vacuum then you have
> to check
> the visibility.

The advantage to Bruce's idea is that it sounds pretty simple to
implement. While it wouldn't be of use for many general cases, it
*would* be useful for read-only tables, ie: old partitions.
--
Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2007-08-16 06:48:00 Re: Index Tuple Compression Approach?
Previous Message Tom Lane 2007-08-16 02:26:59 Re: XID wraparound and busy databases