Search Postgresql Archives

Re: Problem with index in OR'd expression

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

 



postgresql.org@xxxxxxxxx wrote:
Tom Lane wrote:
you're still gonna lose because those are variables not constants ...

Well, that *is* what I'm hoping to do. I understand how (0 IS NULL) is different from (variable IS NULL), but isn't it reasonable to expect that PG could evaluate that expression only once (knowing that the variable couldn't change during the course of the query execution) and then treat that expression as constant?

Also, I should mention that in my case, the "variables" are actually constants either defined in the function param list (and thus non-modifiable within the function body) or defined with:

  DECLARE vC1 CONSTANT varchar(10) := 'blah'

-type syntax. I would submit that in that situation, it would be reasonable for a user to expect my suggested syntax to still use the indicated indexes.

Do you agree? It it possible that something other than picking up the 'IS NULL' boolean as constant has changed between 8.0.x & 8.2 that might make this work?

Thanks,

jl


[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