Re: 9.2 and index only scans

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: 9.2 and index only scans
Date: 2012-08-28 09:51:04
Message-ID: k1i4a6$g6n$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout, 28.08.2012 10:02:
> I'm not sure how oracle avoids the same issues:
> - The index has no visibility information, so you can't tell if an
> index entry refers to a row you can actually see in your session.
> The visibility map might help here in the future.

In Oracle an index (entry) has the information about transactional visibility.

> - Different versions of the same row (after an UPDATE for example) may
> both be in the index, Now if you're counting a primary key column you
> can work around that.

This also works fine in Oracle due to the visibility information inside the index.
I did a test where I deleted and inserted a bunch of rows in the test table (in a different transaction).
The execution plan - even the real one - still used the index.

> But frankly, counting all the rows in a table is something I never do.

I agree, but I thought it was a nice example to test out this new PostgreSQL feature after seeing the SO question.

Regards
Thomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jobs 2012-08-28 10:34:53 Postgres DBA in Berlin, Germany
Previous Message Mark Morgan Lloyd 2012-08-28 09:07:45 Re: Looking for ODBC drivers for NT4.