Index on wildcard text search

From: Leandro Fanzone <leandro(at)hasar(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Index on wildcard text search
Date: 2002-04-25 19:13:41
Message-ID: 3CC85565.FD27C3A@hasar.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Excuse me if this is a silly question. Say I have a table with a text
field, where I perform search operations always in the following form:

SELECT * from table where LOWER(textfield) like 'X%';

Where "X" is one or more letters ("case insensitive begins with").
Does help in some way if I create a binary tree index on that field? I
mean, having a btree index to search with, "begins with" sounds easier,
but the LOWER operation probably invalidates its use. If this has no
sense, do you have another suggestion for the case?
Thank you,

Leandro Fanzone
Compañía HASAR

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lewis Bergman 2002-04-25 21:40:34 How to do a strange constraint
Previous Message Aarni Ruuhimäki / Megative Tmi / KYMI.com 2002-04-25 17:38:17 Strange behaviour