Re: [SQL] Re: [PERFORM] performance drop when function argument is evaluated in WHERE clause

2014-04-08 Thread Tom Lane
Gerardo Herzig writes: > Tom, thanks (as allways) for your answer. This is a 9.1.12. I have to say, im > not very happy about if-elif-else'ing at all. > The "conditional filter" es a pretty common pattern in our functions, i would > have to add (and maintain) a substantial amount of extra code.

Re: [PERFORM] performance drop when function argument is evaluated in WHERE clause

2014-04-08 Thread Gerardo Herzig
> CC: pgsql-performance@postgresql.org, "pgsql-sql" > Enviados: Martes, 8 de Abril 2014 10:50:01 > Asunto: Re: [PERFORM] performance drop when function argument is evaluated in > WHERE clause > > Gerardo Herzig writes: > > Hi all. I have a function that uses a "si

Re: [PERFORM] performance drop when function argument is evaluated in WHERE clause

2014-04-08 Thread Tom Lane
Gerardo Herzig writes: > Hi all. I have a function that uses a "simple" select between 3 tables. There > is a function argument to help choose how a WHERE clause applies. This is the > code section: > select * from > [...] > where case $3 > when 'I' then [filter 1] > when 'E' then [fil

[PERFORM] performance drop when function argument is evaluated in WHERE clause

2014-04-08 Thread Gerardo Herzig
Hi all. I have a function that uses a "simple" select between 3 tables. There is a function argument to help choose how a WHERE clause applies. This is the code section: select * from [...] where case $3 when 'I' then [filter 1] when 'E' then [filter 2] when 'P' then [filter 3] else