From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: Susan Russo <russo@morgan.harvard.edu>
Cc: pgsql-performance@postgresql.org
Cc: harvsys@morgan.harvard.edu
Subject: Re: specific query (not all) on Pg8 MUCH slower than Pg7
Date: Tue, 8 May 2007 16:48:34 +0200
Message-ID: <20070508144834.GA5678@uio.no> (raw)
In-Reply-To: <200705081418.l48EIY8V026360@larrys.harvard.edu>
References: <200705081418.l48EIY8V026360@larrys.harvard.edu>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: sgunderson@bigfoot.com, russo@morgan.harvard.edu, harvsys@morgan.harvard.edu
Subject: Re: specific query (not all) on Pg8 MUCH slower than Pg7
In-Reply-To: <20070508144834.GA5678@uio.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox