Skip site navigation (1) Skip section navigation (2)

Re: About "Our CLUSTER implementation is pessimal" patch

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Leonardo F <m_lists(at)yahoo(dot)it>
Cc: pgsql-hackers(at)postgresql(dot)org, stark(at)enterprisedb(dot)com
Subject: Re: About "Our CLUSTER implementation is pessimal" patch
Date: 2010-01-15 12:05:32
Message-ID: 4B505A0C.4070403@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Leonardo F wrote:
> I read the thread "Our CLUSTER implementation is pessimal" http://archives.postgresql.org/pgsql-hackers/2008-08/msg01371.php .
> 
> I would like to try/integrate that patch as we use CLUSTER a lot on our system.

Great!

> About that patch:
> 
> 1) would it be possible to use the tuplesort_*tupleslot set of functions instead of writing new ones for HeapTuple? That is: is it that difficult/impossible/nonsense to construct TupleTableSlot from HeapTuple and use those?

Yeah, I think you could do that, I agree it feels better that way.
You'll still need new copytup and comparetup functions, though, to deal
with HeapTupleHeaders instead of MinimalTuples, or modify the existing
ones to handle both. And some way to indicate that you want to preserve
the visibility information when you create the tuplesort, maybe a new
parameter to tuplesort_begin_heap().

> 2) The patch doesn't check "HeapTupleSatisfiesVacuum" before passing it to tuplesort_putrawtuple: would it be reasonable to check the "isdead" flag before calling tuplesort_putrawtuple for each tuple?

Yeah, seems reasonable, to avoid sorting dead tuples unnecessarily.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-hackers by date

Next:From: Boszormenyi ZoltanDate: 2010-01-15 12:16:18
Subject: Re: ECPG DESCRIBE [OUTPUT] support
Previous:From: Leonardo FDate: 2010-01-15 11:45:24
Subject: About "Our CLUSTER implementation is pessimal" patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group