Re: No heap lookups on index - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: No heap lookups on index
Date
Msg-id 43CFD815.2000802@agliodbs.com
Whole thread Raw
In response to Re: No heap lookups on index  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Responses Re: No heap lookups on index  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-hackers
Jonah,

> David has stated that the index to heap visibility check is slowing him 
> down, so what are the possible options:
> 
> - Visibility in indexes (-hackers archives cover the pros/cons)
> - True organized heaps
> - Block level index (Tom/Simon's earlier discussion)

also  - Frozen relations

This last solution was proposed as a possibility for the data 
warehousing case.  For a time-partitioned table, we're going to know 
that all but one of the partitions has not been updated anywhere within 
visible transaction scope, and therefore index-only access is a possibility.

also  - join tables

One of the other most valuable targets for index-only access is the 
"many-to-many join table" whose primary key consists of two (or more) 
foreign keys to two (or more) other tables.  It's actually not necessary 
to check visibility on this kind of table as the visibility of tuples in 
the join table will be determined by the visibility of tuples in the two 
data tables.  Since often join tables consist *only* of the join key, 
being able to do index-only access on them could dramatically speed up 
certian kinds of queries.

Both of the above are "corner cases" but are very common ones and might 
be much easier to implement than the other solutions.

--Josh



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Surrogate keys (Was: enums)
Next
From: "Joshua D. Drake"
Date:
Subject: Re: 8.0.5 Bug in unique indexes?