Search Postgresql Archives

Re: Problem with index in OR'd expression

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

 



On mið, 2006-12-27 at 11:02 -0600, postgresql.org@xxxxxxxxx wrote:
> 
> I was referring to the situation where one has this in a WHERE clause:
> 
>    ((vConstant IS NULL) OR (Table.IndexedCol = vConstant))
> 
> where vConstant is a *constant* parameter in a pl/pgsql function.

Reguardless of the issue whether pl/pgsql could be expected to
optimize this case, I find it difficult to imagine a scenario
where this kind of coding makes sense.

I understand that in some cases on would like to do this with
a *variable* to simplify logic, but what possible gain can
be had from doing this with a constant, other that obfuscation?

It does not make sense to spend CPU-time on  optimizing a case
that is not useful or common.

gnari




[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