Re: Unexpected planner behavior with *_pattern_ops index matching

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unexpected planner behavior with *_pattern_ops index matching
Дата
Msg-id 11777.1414708746@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Unexpected planner behavior with *_pattern_ops index matching  (Fabio Ugo Venchiarutti <fabio@vuole.me>)
Список pgsql-general
Fabio Ugo Venchiarutti <fabio@vuole.me> writes:
>>> Conversion of the pattern to an index qualification requires that the
>>> pattern be a plan-time constant.  STABLE functions, by definition,
>>> are not that.

> I guess it is correct to assume that the same applies to regular
> expressions stored in pl/pgsql variables/arguments then, as they're
> inspected after the plan is cached?

Not necessarily.  Recent PG versions will generate custom plans (ie,
plans for the query with parameter values substituted as constants)
if that consistently offers a significant win over the generic plan.
Which it would as long as the parameter value always reduces to a
reasonably long left-anchored pattern.

            regards, tom lane


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

Предыдущее
От: Fabio Ugo Venchiarutti
Дата:
Сообщение: Re: Unexpected planner behavior with *_pattern_ops index matching
Следующее
От: Devrim Gündüz
Дата:
Сообщение: Re: DBlink, postgres to DB2