Re: Our CLUSTER implementation is pessimal - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Our CLUSTER implementation is pessimal
Date
Msg-id 871vzu6g0q.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Our CLUSTER implementation is pessimal  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Our CLUSTER implementation is pessimal  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:

> Simon Riggs wrote:
>> I think there needs to be an option to force this to do either sorts or
>> indexscans. 
>
> If we use the planner, "set enable_indexscan =off" or "set enable_sort=off"
> ought to work.

Yeah, I've been thinking about how to use the planner to do this. It seems to
me it would be a much better solution because it would allow us to take
advantage of other access paths as well (such as other indexes) and even new
features that don't currently exist (index-only scans...).

To do that it seems to me what we would need to do is add a function
_pg_get_rawtuple_header() which returns the visibility information that HTSV
needs. 

Then we need to construct an SPI query like
SELECT _pg_get_rawtuple_header(), * FROM tab ORDER BY col1, col2, col3, ...

For each tuple we'll have to deform it, and reform it using the new tuple
descriptor and just the columns excluding the header and pass that to the heap
rewrite module. Passing the header separately.

Heap rewrite would have to call HTSV on just the header (with the same hack I
put in for this patch to allow passing InvalidBuffer to HTSV).

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: Synchronous Log Shipping Replication
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: [GENERAL] New shapshot RPMs (Sep 7 2008) are ready for testing