Re: A thought on Index Organized Tables

From: Karl Schnaitter <karlsch(at)gmail(dot)com>
To: Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, heikki(dot)linnakangas(at)enterprisedb(dot)com, pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A thought on Index Organized Tables
Date: 2010-02-24 09:24:31
Message-ID: d13967f91002240124m3e710947j2d8367e8ea564d5a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 24, 2010 at 12:53 AM, Gokulakannan Somasundaram <
gokul007(at)gmail(dot)com> wrote:

>
> Again not to deviate from my initial question, can we make a decision
> regarding unstable/mutable functions / broken data types ?
>
>
I second this question. A year or two ago, Gokul and I both proposed a
feature that put visibility metadata into the index tuples and supported
index-only scans, and the idea was dismissed because a user might choose
incorrect ordering operators. I tried to ask for a clear explanation of the
issue, but never got it.

Incorrect operators and mutable functions will surely lead to incorrect
query results, but that is already a possibility with any index. It's also
possible that a heap tuple is deleted, but the deletion is not recorded in
the index because the tuple wasn't found. This is okay because (1) the heap
tuple will remain where it is until vacuuming, and (2) during vacuuming, the
visibility metadata in the index should be ignored when determining whether
an index tuple points to a dead heap tuple. This ensures that all references
to a heap tuple are removed before wiping it out.

The bottom line is that the visibility metadata is a good thing if you know
when to trust it. It's fine to trust it when evaluating a SELECT. But not
during a more dangerous operation like VACUUM.

Karl

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2010-02-24 09:59:29 Re: Re: [COMMITTERS] pgsql: Move documentation of all recovery.conf option to a new chapter.
Previous Message Simon Riggs 2010-02-24 09:24:13 Re: A thought on Index Organized Tables