pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: Layet Benjamin <benjamin@moonfactory.co.jp>
To: pgsql-performance@postgresql.org
Subject: Re: best practices with index on varchar column
Date: Tue, 22 Mar 2005 11:49:36 +0100
Message-ID: <op.sn1ccygeth1vuj@localhost> (raw)
In-Reply-To: <007301c52ec0$a8f64ec0$9285a8c0@moonfactory.co.jp>
References: <007301c52ec0$a8f64ec0$9285a8c0@moonfactory.co.jp>


> Can I use an index on a varchar column to optimize the SELECT queries  
> that
> use " column LIKE 'header%'  "?

	Yes

> If yes what is the best tree algotithm to use ?

	Btree

	Note that if you want case insensitive matching you need to make an index  
on lower(column) and SELECT WHERE lower(column) LIKE 'header%'

	Locales may bite you.



view thread (7+ messages)  latest in thread

Message-ID: <op.sn1ccygeth1vuj@localhost>
Permalink:  ../op.sn1ccygeth1vuj@localhost/
Also on:    postgresql.org/message-id/op.sn1ccygeth1vuj@localhost

 · 

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-performance@postgresql.org
  Cc: lists@boutiquenumerique.com, benjamin@moonfactory.co.jp
  Subject: Re: best practices with index on varchar column
  In-Reply-To: <op.sn1ccygeth1vuj@localhost>

* 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