From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: Steve Horn <steve@stevehorn.cc>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query slow as Function
Date: Sat, 18 Feb 2012 11:41:18 -0500
Message-ID: <4F3FD4AE.30908@dunslane.net> (raw)
In-Reply-To: <27854.1329583042@sss.pgh.pa.us>
References: <CAFLkBaWRKp7+yVdk3dCecztxEztc+YFS4ks=x3KiSWSfyDZvKw@mail.gmail.com>
<20120218160244.GA23315@tux>
<27854.1329583042@sss.pgh.pa.us>
On 02/18/2012 11:37 AM, Tom Lane wrote:
> Andreas Kretschmer<akretschmer@spamfence.net> writes:
>> You can check the plan with the auto_explain - Extension, and you can
>> force the planner to create a plan based on the actual input-value by
>> using dynamic SQL (EXECUTE 'your query string' inside the function)
> Steve *is* using EXECUTE, so that doesn't seem to be the answer. I'm
> wondering about datatype mismatches myself --- the function form is
> forcing the parameter to be char(9), which is not a constraint imposed
> in the written-out query. There are lots of other possibilities
> though. It would be hard to say much without a self-contained example
> to try.
>
>
He's using EXECUTE ... USING. Does that plan with the used parameter?
cheers
andrew
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us, akretschmer@spamfence.net, steve@stevehorn.cc
Subject: Re: Query slow as Function
In-Reply-To: <4F3FD4AE.30908@dunslane.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox