Re: How to boost performance of ilike queries ?

Поиск
Список
Период
Сортировка
От Russell Smith
Тема Re: How to boost performance of ilike queries ?
Дата
Msg-id 200501242058.54670.mr-russ@pws.com.au
обсуждение исходный текст
Ответ на How to boost performance of ilike queries ?  (Antony Paul <antonypaul24@gmail.com>)
Ответы Re: How to boost performance of ilike queries ?
Список pgsql-performance
On Mon, 24 Jan 2005 08:18 pm, Antony Paul wrote:
> Hi,
>     I have a query which is executed using ilike. The query values are
> received from user and it is executed using PreparedStatement.
> Currently all queries are executed as it is using iilike irrespective
> of whether it have a pattern matching character or not. Can using =
> instead of ilike boot performance ?.  If creating index can help then
> how the index should be created on lower case or uppercase ?.
>
It depends on the type of queries you are doing.

changing it to something like  lower(column) like lower('text%'), and
creating an index on lower(column) will give you much better performance.

If you have % in the middle of the query, it will still be slow, but I assume that is not
the general case.

I am not sure what the effect of it being prepared will be, however I've had much success
with the method above without the queries being prepared.  Others may be able to offer advice
about if prepare will effect it.

Regards

Russell Smith

В списке pgsql-performance по дате отправления:

Предыдущее
От: Andrei Reinus
Дата:
Сообщение: Re: poor performance of db?
Следующее
От: Chris Mair
Дата:
Сообщение: Re: poor performance of db?