Re: I: About "Our CLUSTER implementation is pessimal" patch
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Itagaki Takahiro <itagaki.takahiro@gmail.com>
Cc: Leonardo Francalanci <m_lists@yahoo.it>, Josh Kupershmidt <schmiddy@gmail.com>, pgsql-hackers@postgresql.org
Date: 2010-10-08T00:10:52Z
Lists: pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@gmail.com> writes: > I re-ordered some description in the doc. Does it look better? > Comments and suggestions welcome. Applied with some significant editorialization. The biggest problem I found was that the code for expression indexes didn't really work, and would leak memory like there's no tomorrow even when it did work. I fixed that, but I think the performance is still going to be pretty undesirable. We have to re-evaluate the index expressions for each tuple each time we do a comparison, which means it's going to be really really slow unless the index expressions are *very* cheap. But perhaps the use-case for clustering on expression indexes is small enough that this isn't worth worrying about. I considered computing the index expressions just once as the data is being fed in, and including their values in the tuples-to-be-sorted; that would cut the number of times the values have to be computed by a factor of about log N. But it'd also bloat the on-disk sort data, which could possibly cost more in I/O than we save. So it's not real clear what to do anyway. regards, tom lane