Re: Text pattern JOINs that use indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Text pattern JOINs that use indexes
Дата
Msg-id 25042.1079378988@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Text pattern JOINs that use indexes  (Richard Brooksby <rb@ravenbrook.com>)
Ответы Re: Text pattern JOINs that use indexes  (Richard Brooksby <rb@ravenbrook.com>)
Список pgsql-novice
Richard Brooksby <rb@ravenbrook.com> writes:
> explain select * from files where name like 'foo%';

This is indexable because the LIKE pattern is a constant at plan time,
and so the planner can see that there's a useful range constraint
extractable from the pattern.

> explain select * from test join files on files.name like test.filename
> || '%';

This is not indexable, because the LIKE pattern is not constant.

            regards, tom lane

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

Предыдущее
От: Richard Brooksby
Дата:
Сообщение: Text pattern JOINs that use indexes
Следующее
От: Richard Brooksby
Дата:
Сообщение: Re: Text pattern JOINs that use indexes