pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Julian Scarfe <julian.scarfe@ntlworld.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Indexes with LIKE
Date: Sat, 13 Jul 2002 08:28:34 -0700 (PDT)
Message-ID: <20020713082522.U19431-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <000901c22a53$206e0ad0$0500a8c0@Wilbur>

On Sat, 13 Jul 2002, Julian Scarfe wrote:

> I've noticed a difference in behaviour between a server running version 6.x
> and one running 7.2.1 in use of indexes with LIKE.
>
> With an index on foo,
>
> WHERE foo LIKE 'bar%'
>
> uses the index (as I would expect it to) on the 6.x box, but uses a
> sequential scan (really slow) on the 7.2.1 box.
> It's possible that I've set (or failed to set)  a run-time parameter that
> controls the behaviour, but I don't know what that might be. ANALYZEing the
> table doesn't modify the behaviour.
>
> I can't find any mention of this in the documentation -- any pointers would
> be appreciated.

You need to have made the database in C locale in order to get index scans
from LIKE.  I think that's mentioned in the Localization section of the
admin guide, but I could be remembering that wrong.





view thread (4+ messages)  latest in thread

Message-ID: <20020713082522.U19431-100000@megazone23.bigpanda.com>
Permalink:  ../20020713082522.U19431-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020713082522.U19431-100000@megazone23.bigpanda.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, julian.scarfe@ntlworld.com
  Subject: Re: Indexes with LIKE
  In-Reply-To: <20020713082522.U19431-100000@megazone23.bigpanda.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