Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9087F2E009C for ; Sat, 12 Jan 2008 01:37:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 09109-04 for ; Sat, 12 Jan 2008 01:37:34 -0400 (AST) Received: from pillette.com (adsl-67-119-5-202.dsl.snfc21.pacbell.net [67.119.5.202]) by postgresql.org (Postfix) with ESMTP id 8BDA52E008C for ; Sat, 12 Jan 2008 01:37:33 -0400 (AST) Received: (from andrew@localhost) by pillette.com (8.11.6/8.11.6) id m0C5bTJ18551; Fri, 11 Jan 2008 21:37:29 -0800 Date: Fri, 11 Jan 2008 21:37:29 -0800 From: andrew@pillette.com Message-Id: <200801120537.m0C5bTJ18551@pillette.com> Subject: Re: Simple select, but takes long time To: "James DeMichele" Cc: X-Originating-IP: 71.135.74.75 X-Mailer: Webmin 0.940 MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.154 tagged_above=0 required=5 tests=AWL=-0.431, BAYES_40=-0.185, FH_HOST_EQ_PACBELL_D=1.67, RDNS_DYNAMIC=0.1 X-Spam-Level: * Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Archive-Number: 200801/102 X-Sequence-Number: 28341 "James DeMichele" wrote .. > Then, I have the following index on the table: > "this_index" (status, source_id, ) 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.