Re: LIKE vrs ~~
| От | Peter Eisentraut |
|---|---|
| Тема | Re: LIKE vrs ~~ |
| Дата | |
| Msg-id | Pine.LNX.4.21.0006040326220.348-100000@localhost.localdomain обсуждение исходный текст |
| Ответ на | LIKE vrs ~~ ("T.J.Farrell" <T.J.Farrell@wanadoo.fr>) |
| Список | pgsql-sql |
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 по дате отправления: