Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C3B399FBC1A for ; Tue, 8 May 2007 11:48:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 87988-09 for ; Tue, 8 May 2007 11:48:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id BC2B49FBB49 for ; Tue, 8 May 2007 11:48:38 -0300 (ADT) Received: from trofast.sesse.net ([129.241.93.32]) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1HlQzS-0002Mf-Kx; Tue, 08 May 2007 16:48:35 +0200 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1HlQzS-0001UB-00; Tue, 08 May 2007 16:48:34 +0200 Date: Tue, 8 May 2007 16:48:34 +0200 From: "Steinar H. Gunderson" To: Susan Russo Cc: pgsql-performance@postgresql.org, harvsys@morgan.harvard.edu Subject: Re: specific query (not all) on Pg8 MUCH slower than Pg7 Message-ID: <20070508144834.GA5678@uio.no> Mail-Followup-To: Susan Russo , pgsql-performance@postgresql.org, harvsys@morgan.harvard.edu References: <200705081418.l48EIY8V026360@larrys.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <200705081418.l48EIY8V026360@larrys.harvard.edu> X-Operating-System: Linux 2.6.20.4 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/119 X-Sequence-Number: 24509 On Tue, May 08, 2007 at 10:18:34AM -0400, Susan Russo wrote: > explain analyze output on Pg7.3.2: > > -> Index Scan using dbxref_idx2 on dbxref dx (cost=0.00..5.83 rows=1 width=21) (actual time=25.58..25.58 rows=0 loops=1) > Index Cond: ((accession >= 'AY851043'::character varying) AND (accession < 'AY851044'::character varying)) > Filter: (accession ~~ 'AY851043%'::text) > > explain analyze output on Pg8.1.4: > > -> Seq Scan on dbxref dx (cost=0.00..47923.91 rows=1 width=21) (actual time=2463.646..2463.646 rows=0 loops=1) > Filter: ((accession)::text ~~ 'AY851043%'::text) This is almost all of your cost. Did you perchance initdb the 8.1.4 cluster in a non-C locale? You could always try CREATE INDEX test_index ON dbxref (accession varchar_pattern_ops); which would create an index that might be more useful for your LIKE query, even in a non-C locale. /* Steinar */ -- Homepage: http://www.sesse.net/