Search Postgresql Archives

Re: Unexpected planner behavior with *_pattern_ops index matching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fabio Ugo Venchiarutti <fabio@xxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux