Re: slow query performance

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Dave Weaver <davew(at)wsieurope(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: slow query performance
Date: 2003-10-31 21:18:14
Message-ID: 3FA2D196.70702@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Dave Weaver wrote:

>>- clustering the "obs" table on "station"
>>
>>
>
>Sorry, I don't understand what you mean by this - can you explain?
>
>
>
Supposing obs_pkey is on (station, valid_time):

cluster obs_pkey on obs

will re-order the rows in obs based on the index obs_pkey. (This is
clustering on 'station' and 'valid_time', to do just station you could
use an index on just 'station').

The down side is that the row ordering is slowly lost as rows are
updated, so periodic running of the cluster command is needed - this is
a pain as it will take a while for 13 million row table.

regards

Mark

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-10-31 21:24:22 Re: Cartesian product bug?
Previous Message Tom Lane 2003-10-31 21:16:36 Re: duplicates rejected by index reports PGSQL_FATAL_ERROR