Re: LIKE, leading percent, bind parameters and indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: LIKE, leading percent, bind parameters and indexes
Дата
Msg-id 24934.1148439323@sss.pgh.pa.us
обсуждение исходный текст
Ответ на LIKE, leading percent, bind parameters and indexes  ("Rodrigo Hjort" <rodrigo.hjort@gmail.com>)
Ответы Re: LIKE, leading percent, bind parameters and indexes  ("Rodrigo Hjort" <rodrigo.hjort@gmail.com>)
Список pgsql-hackers
"Rodrigo Hjort" <rodrigo.hjort@gmail.com> writes:
> What happens is that only the "004" block uses the index! The "002" code,
> which also has no leading percent, does a sequential scan. The difference
> between them is that "002" uses bind parameters.

Yeah.  The LIKE index optimization depends on seeing a constant LIKE
pattern at plan time --- otherwise the planner doesn't know what
indexscan parameters to generate.  So a bound-parameter query loses.

Ideas for improving this situation are welcome ... it's not an easy
problem ...
        regards, tom lane


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Why is CVS server so slow?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why is CVS server so slow?