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

From Sam Mason
Subject Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan
Date
Msg-id 20100122145434.GW5407@samason.me.uk
Whole thread Raw
In response to Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan  (Yan Cheng Cheok <yccheok@yahoo.com>)
Responses Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan  (Vincenzo Romano <vincenzo.romano@notorand.it>)
Re: Shall I convert all my stored procedure to use "EXECUTE", to ensure I get index-scan  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-general
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.  That's normally
going to be a win, but for some queries PG will end up spending longer
planning the queries than it will running them.

Also, if you're only testing with made up datasets and not the whole
thing, PG will be behaving differently.  You can only really see what's
going on when you're testing with the real data.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: "Alberto Colombo"
Date:
Subject: Re: timestamps, epoch and time zones
Next
From: Volkan Varol
Date:
Subject: DDL question