Re: Optimizing a like-cause - Mailing list pgsql-general

From Alan Hodgson
Subject Re: Optimizing a like-cause
Date
Msg-id 200807221330.11270@hal.medialogik.com
Whole thread Raw
In response to Optimizing a like-cause  (Stefan Sturm <stefan.s.sturm@googlemail.com>)
List pgsql-general
On Tuesday 22 July 2008, Stefan Sturm <stefan.s.sturm@googlemail.com> wrote:
> 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?

No index can be used for that query (where it starts with %).

--
Alan

pgsql-general by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: Optimizing a like-cause
Next
From: "Adam Rich"
Date:
Subject: Re: Optimizing a like-cause