Re: Optimizing a like-cause

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Optimizing a like-cause
Date: 2008-07-22 20:30:11
Message-ID: 200807221330.11270@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 22 July 2008, Stefan Sturm <stefan(dot)s(dot)sturm(at)googlemail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Rich 2008-07-22 20:36:13 Re: Optimizing a like-cause
Previous Message Dann Corbit 2008-07-22 20:29:37 Re: Optimizing a like-cause