From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Ian Harding <iharding(at)pakrat(dot)com> |
Cc: | Martijn van Oosterhout <kleptog(at)cupid(dot)suninternet(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Re: Loading optimization |
Date: | 2001-01-11 17:38:01 |
Message-ID: | 11900.979234681@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Ian Harding <iharding(at)pakrat(dot)com> writes:
> Tom Lane wrote:
>> The CLUSTER implementation is so shoddy at the moment that I'm hesitant
>> to encourage people to use it anyway :-(. We've got to rewrite it so
>> that it doesn't drop other indexes, lose constraints, break foreign
>> key and inheritance relationships, etc etc.
> Are the problems with CLUSTER isolated to the creation of the clustering,
> or the maintenance of it?
I guess you could consider it a bug that the clustered order is not
preserved by subsequent inserts/updates, but I don't. Otherwise the
problem is just with creation. That effectively does something like
SELECT * INTO temp_NNN FROM your_table ORDER BY index_var;
and then drops your_table and renames temp_NNN into place. So all
that's copied are the column types; you lose all other auxiliary info
about the table.
Now that I look at the code, it'd be very easy to preserve constraints
(a small change in the code would allow copying them to the new table)
so maybe we should do that. But the other issues like inheritance
relationships can't be fixed without a fundamentally different
implementation method, one that preserves the identity (OID) of the
table. You can find past discussions about how to do this in the
pghackers archives; it seems within reach given the changes made for
7.1, so perhaps someone will get to it in 7.2 or so.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | excalibur | 2001-01-11 18:04:27 | Java Classes |
Previous Message | Rosa Maria Carro Salas | 2001-01-11 17:11:20 | RecordSets, getString and charSets |