Re: LIKE vrs ~~

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: LIKE vrs ~~
Дата
Msg-id
Pine.LNX.4.21.0006040326220.348-100000@localhost.localdomain
Ответ на
LIKE vrs ~~ (T.J.Farrell)
Список
Дерево обсуждения
LIKE vrs ~~ "T.J.Farrell" <T.J.Farrell@wanadoo.fr>
Re: LIKE vrs ~~ Tom Lane <tgl@sss.pgh.pa.us>
Re: LIKE vrs ~~ Peter Eisentraut <peter_e@gmx.net>
T.J.Farrell writes:

> I was wondering about the performance incidence of :
> SELECT *  FROM table1 WHERE UPPER(field1) LIKE UPPER('%thomas%');
> versus:
> SELECT * FROM table1 WHERE field1 ~~ '%thomas%'

If you're comparing ~~ with LIKE then there's no difference at all. (Only
the extra cycles to convert LIKE to ~~ internally.) If you're comparing 
true case-insensitive matching to using UPPER, then the latter is probably
faster but doesn't really do the same thing.

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



В списке pgsql-sql по дате отправления
От: qzhwjb@myhome.net
Дата:
Сообщение: Ho Ho Ho !!! 6684
От: Tom Lane
Дата:
Сообщение: Re: LIKE vrs ~~
FAQ