Heikki Linnakangas <[EMAIL PROTECTED]> 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! -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers