Re: Another idea for index-only scans

From: "Luke Lonergan" <LLonergan(at)greenplum(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Another idea for index-only scans
Date: 2007-08-15 19:01:43
Message-ID: C3E62232E3BCF24CBA20D72BFDCB6BF8044A1BF2@MI8NYCMAIL08.Mi8.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

A hybrid scan approach combined with this idea would fit nicely - provide results for tids that are directly visible and set a bit in a bitmap for those that need recheck and extend recheck to take a bitmap (wait - it already does :-)

- Luke

Msg is shrt cuz m on ma treo

-----Original Message-----
From: Gregory Stark [mailto:stark(at)enterprisedb(dot)com]
Sent: Wednesday, August 15, 2007 02:58 PM Eastern Standard Time
To: Bruce Momjian
Cc: PostgreSQL-development
Subject: Re: [HACKERS] Another idea for index-only scans

"Bruce Momjian" <bruce(at)momjian(dot)us> writes:

> I have added another idea for index-only scans to the TODO list:
>
>> 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.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2007-08-15 19:12:17 Re: CVS corruption/mistagging?
Previous Message Heikki Linnakangas 2007-08-15 18:57:53 Re: XID wraparound and busy databases