Re: LIKE pattern

Поиск
Список
Период
Сортировка
От SoDupuDupu
Тема Re: LIKE pattern
Дата
Msg-id 1462830066860-5902701.post@n5.nabble.com
обсуждение исходный текст
Ответ на LIKE pattern  (Владимир <vovka@krevedko.su>)
Ответы Re: LIKE pattern  (Robert Klemme <shortcutter@googlemail.com>)
Список pgsql-performance
Владимир-3 wrote
> It seems my quite complex query runs 10 times faster on "some_column
> LIKE '%test_1' " vs "some_column LIKE 'test_1' "
> So I just add "%"  to the pattern...

Keep in mind then LIKE '%test_1' and LIKE 'test_1' are not equivalent, using
the % as a prefix to the argument means that the scan only has to confirm
that the value ends in 'test_1' where forgoing the % entirely means that you
are essentially saying some_column='test_1'.




--
View this message in context: http://postgresql.nabble.com/LIKE-pattern-tp5902225p5902701.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


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

Предыдущее
От: Владимир
Дата:
Сообщение: LIKE pattern
Следующее
От: Robert Klemme
Дата:
Сообщение: Re: LIKE pattern