Re: SRF called with optional NULL input runs 7x slower

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
Cc: ML PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: SRF called with optional NULL input runs 7x slower
Date: 2007-09-24 06:31:48
Message-ID: 20070924063148.GH5661@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ow Mun Heng wrote:

> Okay.. I tried that, but it seems like there's an issue w/ the CASE
> statements.
>
> When I tried the prepare w/
>
> AND (CASE WHEN $3 IS NULL THEN true else d.code = any ($3) END)
> AND (CASE WHEN $4 IS NULL THEN TRUE else D.id = any($4) END)
>
>
> it ERRORs w/ could not determine data type of parameter $3

Cast it to the correct type.

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Cómo ponemos nuestros dedos en la arcilla del otro. Eso es la amistad; jugar
al alfarero y ver qué formas se pueden sacar del otro" (C. Halloway en
La Feria de las Tinieblas, R. Bradbury)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2007-09-24 06:53:49 Re: SRF called with optional NULL input runs 7x slower
Previous Message Ow Mun Heng 2007-09-24 05:44:28 Re: SRF called with optional NULL input runs 7x slower