Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 515FE9FBC1A for ; Tue, 8 May 2007 11:48:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 00573-02 for ; Tue, 8 May 2007 11:48:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id A5ACA9FBB49 for ; Tue, 8 May 2007 11:48:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l48EmPHC001161; Tue, 8 May 2007 10:48:26 -0400 (EDT) To: Susan Russo cc: pgsql-performance@postgresql.org, harvsys@morgan.harvard.edu Subject: Re: specific query (not all) on Pg8 MUCH slower than Pg7 In-reply-to: <200705081418.l48EIY8V026360@larrys.harvard.edu> References: <200705081418.l48EIY8V026360@larrys.harvard.edu> Comments: In-reply-to Susan Russo message dated "Tue, 08 May 2007 10:18:34 -0400" Date: Tue, 08 May 2007 10:48:25 -0400 Message-ID: <1160.1178635705@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/118 X-Sequence-Number: 24508 Susan Russo writes: > Despite numerous efforts, we're unable to solve a severe performance limitation between Pg 7.3.2 > and Pg 8.1.4. > The query and 'explain analyze' plan below, runs in > 26.20 msec on Pg 7.3.2, and > 2463.968 ms on Pg 8.1.4, You're not getting the indexscan optimization of the LIKE clause, which is most likely due to having initdb'd the 8.1 installation in something other than C locale. You can either redo the initdb in C locale (which might be a good move to fix other inconsistencies from the 7.3 behavior you're used to) or create a varchar_pattern_ops index on the column(s) you're using LIKE with. regards, tom lane