Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan - Mailing list pgsql-general

From Craig Ringer
Subject Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan
Date
Msg-id 4B5A61C7.4060504@postnewspapers.com.au
Whole thread Raw
In response to Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
On 22/01/2010 10:54 PM, Sam Mason wrote:
> On Fri, Jan 22, 2010 at 01:49:50AM -0800, Yan Cheng Cheok wrote:
>> By refering to
>> http://archives.postgresql.org/pgsql-general/2010-01/msg00846.php
>>
>> Does this means, I shall convert *ALL* my stored procedure, which use
>> function parameter during its SQL query, to use EXECUTE, to ensure I
>> always get index-scan?
>
> I wouldn't bother, mainly because converting to EXECUTE does *not*
> ensure it'll use an index scan.  Just that the stats it's picking up
> will be more appropriate to the query in question.

I increasingly wish I had the brain-power to tackle implementing a
'REPLAN' option on PL/PgSQL functions and/or an 'EXECUTE REPLAN' for
prepared queries...

--
Craig Ringer

pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: Slow Query / Check Point Segments
Next
From: Scott Marlowe
Date:
Subject: Re: When is the release date for Postgres 8.5?