Optimizing a like-cause

From: Stefan Sturm <stefan(dot)s(dot)sturm(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Optimizing a like-cause
Date: 2008-07-22 18:30:55
Message-ID: 26353992-BFEA-47A9-B73C-02F05B314211@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I'm developing a autocomplete Feature using php and PostgreSQL 8.3.
To fill the autocomplete box I use the following SQL Statement:
select * from _table_ where upper( _field_ ) like '%STRING%';

This SQL Statement takes 900 ms on a Table with 300.000 entries.

What can I do to speed up the Statement? What Index can I set?

Thanks for your Help,
Stefan Sturm

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Glyn Astill 2008-07-22 18:35:50 Re: Initdb problem on debian mips cobalt: Bus error
Previous Message Rich Shepard 2008-07-22 18:30:13 Re: Problems Restarting PostgreSQL Daemon