Re: Simple select, but takes long time

From: andrew(at)pillette(dot)com
To: "James DeMichele" <James(dot)DeMichele(at)redfin(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Simple select, but takes long time
Date: 2008-01-12 05:37:29
Message-ID: 200801120537.m0C5bTJ18551@pillette.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"James DeMichele" <James(dot)DeMichele(at)redfin(dot)com> wrote ..

> Then, I have the following index on the table:

> "this_index" (status, source_id, <another_column>)

If you have many queries of this type, do

CLUSTER this_index ON tablename;

and retry the SELECT.

MySQL is using some sort of auto-clustering ISAM on the other box mayhaps?

In Postgres you will have to re-CLUSTER periodically if there are INSERTs and UPDATEs.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-01-12 05:44:14 Re: Simple select, but takes long time
Previous Message Greg Smith 2008-01-12 02:56:38 Re: Best way to index IP data?