Re: More Performance - Mailing list pgsql-hackers

From Tom Lane
Subject Re: More Performance
Date
Msg-id 25715.958871629@sss.pgh.pa.us
Whole thread Raw
In response to Re: More Performance  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> What heap? The index is a b-tree in this case. Thus you should be able
>> to walk it and get the sorted result without ever touching the data
>> file.

> We can't read data from the index.  It would be nice if we could, but we
> can't.

The reason we can't is that we don't store tuple validity data in
indexes.  The index entry has the key value and a pointer to the tuple
in the main heap file, but we have to visit the tuple to find out
whether it's committed or dead.  If we did otherwise, then committing or
killing tuples would be lots slower than it is, because we'd have to
find and mark all the index entries pointing at the tuple, not just the
tuple itself.  It's a tradeoff... but we think it's a good one.

> I think we believe that there are very few cases where this
> would be win.  Usually you need non-indexed data too.

Right, non-toy examples usually read additional data columns anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Robert B. Easter"
Date:
Subject: Re: Thus spoke SQL3 (on OO)
Next
From: "Mikheev, Vadim"
Date:
Subject: Berkeley DB...