Use of data within indexes

From: Jacques Caron <jc(at)directinfos(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Use of data within indexes
Date: 2005-04-14 09:45:03
Message-ID: 6.2.0.14.0.20050414113816.051f7e68@pop.interactivemediafactory.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

Just wondering... Is Postgresql able to use data present within indexes
without looking up the table data?

To be more explicit, let's say I have table with two fields a and b. If I
have an index on (a,b) and I do a request like "SELECT b FROM table WHERE
a=x", will Postgresql use only the index, or will it need to also read the
table page for that (those) row(s)?

There might be a reason why this is not possible (I don't know if the
indexes have all necessary transaction ID information?) but otherwise this
could possibly provide an interesting performance gain for some operations,
in particular with some types of joins. Or maybe it already does it.

Any hint welcome!

Thanks,

Jacques.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Richard van den Berg 2005-04-14 11:59:52 Foreign key slows down copy/insert
Previous Message Kevin Brown 2005-04-14 08:36:08 Re: How to improve db performance with $7K?