pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Olivier Hubaut <olivier@scmbb.ulb.ac.be>
To: pgsql-sql@postgresql.org
Subject: Re: INDEX and LIKE
Date: Mon, 29 Nov 2004 14:45:42 +0100
Message-ID: <opsh8a6gzu94ope3@olivier.amaze.ulb.ac.be> (raw)
In-Reply-To: <41AB13C0.40909@numerixtechnology.de>
References: <41AB13C0.40909@numerixtechnology.de>

On Mon, 29 Nov 2004 12:19:12 +0000, T E Schmitz  
<mailreg@numerixtechnology.de> wrote:

> Hello,
>
> I need to be able to perform wildcard searches on a VARCHAR(100) column  
> of the form
>
> SELECT * FROM item WHERE serial_no LIKE '%12345678%'
>
> Would an index on serial_no do anything at all for this search?
>
No, It wouldn't. If you use "%" for the beginning of you search pattern, a  
seqential search is performed, ignoring the index wich use the beginning  
of the string in order to create it's B-tree.


-- 
Downloading signature ... 99%
*CRC FAILED*
signature aborted



view thread (2+ messages)

Message-ID: <opsh8a6gzu94ope3@olivier.amaze.ulb.ac.be>
Permalink:  ../opsh8a6gzu94ope3@olivier.amaze.ulb.ac.be/
Also on:    postgresql.org/message-id/opsh8a6gzu94ope3@olivier.amaze.ulb.ac.be

 · 

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: olivier@scmbb.ulb.ac.be
  Subject: Re: INDEX and LIKE
  In-Reply-To: <opsh8a6gzu94ope3@olivier.amaze.ulb.ac.be>

* 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