Re: Re: Loading optimization - Mailing list pgsql-general

From Tom Lane
Subject Re: Re: Loading optimization
Date
Msg-id 1651.979063185@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: Loading optimization  (Martijn van Oosterhout <kleptog@cupid.suninternet.com>)
List pgsql-general
Martijn van Oosterhout <kleptog@cupid.suninternet.com> writes:
> But does postgres actually use the fact that the data is clustered?

The planner has no idea that the table is clustered, and will estimate
indexscan costs on the assumption that the data is randomly ordered in
the table.  So you're likely to get a seqscan plan for queries where
indexscan would actually be faster.  This is something we need to fix,
but the main problem is accounting for the fact that the clustered order
will degrade over time as data is added/updated.  See past discussions
in pghackers.

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.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: shutting down postmasters
Next
From: Tom Lane
Date:
Subject: Re: trouble with db-restore