pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julian Scarfe <julian.scarfe@ntlworld.com>
To: pgsql-sql@postgresql.org
Subject: Indexes with LIKE
Date: Sat, 13 Jul 2002 10:53:23 +0100
Message-ID: <000901c22a53$206e0ad0$0500a8c0@Wilbur> (raw)

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.

If the above doesn't ring any bells, I'll put together an example.

Many thanks

Julian Scarfe





view thread (4+ messages)  latest in thread

Message-ID: <000901c22a53$206e0ad0$0500a8c0@Wilbur>
Permalink:  ../000901c22a53$206e0ad0$0500a8c0@Wilbur/
Also on:    postgresql.org/message-id/000901c22a53$206e0ad0$0500a8c0@Wilbur

 · 

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: julian.scarfe@ntlworld.com
  Subject: Re: Indexes with LIKE
  In-Reply-To: <000901c22a53$206e0ad0$0500a8c0@Wilbur>

* 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