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

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan
Date: 2010-01-23 02:41:11
Message-ID: 4B5A61C7.4060504@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-01-23 04:02:58 Re: When is the release date for Postgres 8.5?
Previous Message Greg Smith 2010-01-23 02:11:18 Re: Slow Query / Check Point Segments