pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Jeff Boes <jboes@nexcerpt.com>
To: pgsql-performance@postgresql.org
Subject: Re: Optimizer differences between 7.2 and 7.3
Date: Mon, 7 Jul 2003 15:40:30 +0100
Message-ID: <200307071540.30041.dev@archonet.com> (raw)
In-Reply-To: <1057587455.6466.26.camel@takin.private.nexcerpt.com>
References: <1057587455.6466.26.camel@takin.private.nexcerpt.com>

On Monday 07 Jul 2003 3:17 pm, Jeff Boes wrote:
> Our production database is running under 7.2.4; our test database
> running almost the same data is at 7.3.3.  One table has about 400,000
> rows in each schema. A query against an indexed column uses an index
> scan under 7.2.4, but a sequential scan under 7.3.3. A count of the
> table in question shows that they have comparable numbers of matching
> rows.
[snip[
> select count(*) from articles
>  where path_base like 'http://news.findlaw.com/hdocs%';;
>  count
> -------
>     38
[snip]
> I can't find any differences between the indexes (ix_articles_3 exists
> in both schemas); the column statistics are set up the same (the
> default); and the optimizer settings (costs in postgresql.conf) are the
> same.

Check the locale the database was initdb'd to. You'll probably find 7.2.4 is 
in the "C" locale whereas 7.3.3 isn't. The "like" comparison can only use 
indexes in the "C" locale. I believe you might need to initdb again to fix 
this.

-- 
  Richard Huxton



view thread (4+ messages)  latest in thread

Message-ID: <200307071540.30041.dev@archonet.com>
Permalink:  ../200307071540.30041.dev@archonet.com/
Also on:    postgresql.org/message-id/200307071540.30041.dev@archonet.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, jboes@nexcerpt.com
  Subject: Re: Optimizer differences between 7.2 and 7.3
  In-Reply-To: <200307071540.30041.dev@archonet.com>
  References: <1057587455.6466.26.camel@takin.private.nexcerpt.com> <200307071540.30041.dev@archonet.com>

* 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