X-Original-To: pgsql-performance@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 53F0B925B12 for ; Thu, 29 May 2003 10:09:28 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 63737-04 for ; Thu, 29 May 2003 10:09:27 -0400 (EDT) Received: from relay.netcetra.com (unknown [198.65.147.132]) by developer.postgresql.org (Postfix) with ESMTP id 2E8109258D8 for ; Thu, 29 May 2003 10:09:27 -0400 (EDT) Received: from WORKSTATION (frsc-dsldyna-66-228-147-1.advantexcom.net [66.228.147.1]) by relay.netcetra.com (8.11.6/8.11.6) with SMTP id h4TE1lZ21473 for ; Thu, 29 May 2003 10:01:47 -0400 (EDT) Message-ID: <006d01c325eb$eb72fdf0$0200a8c0@WORKSTATION> From: "Kevin Schroeder" To: Subject: Query problem fixed Date: Thu, 29 May 2003 09:09:23 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/263 X-Sequence-Number: 2042 I figured out how to make the query faster. There should be a mailing list set up for wasted questions since I always seem to figure out the problem after I've bugged everyone for help. In the query select row_key, column1, column2, column3, column4, column5 from table1 where column6 = 1 order by column3 desc limit 21; I changed the index to message_index btree (column3, column6) rather than message_index btree (column6, column3, column7) Since the data was being ordered by column3 it seems to have sped the query up to 1 ms from 6000ms by making column 3 the first part of the index rather than the second. Kevin