pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: fche@redhat.com
Cc: Mario Splivalo <mario.splivalo@megafon.hr>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query much slower when run from postgres function
Date: Tue, 10 Mar 2009 13:20:47 -0400
Message-ID: <355.1236705647@sss.pgh.pa.us> (raw)
In-Reply-To: <y0mr615785o.fsf@ton.toronto.redhat.com>
References: <49B51B60.6030600@megafon.hr>
	<27649.1236616294@sss.pgh.pa.us>
	<y0mr615785o.fsf@ton.toronto.redhat.com>

fche@redhat.com (Frank Ch. Eigler) writes:
> For a prepared statement, could the planner produce *several* plans,
> if it guesses great sensitivity to the parameter values?  Then it
> could choose amongst them at run time.

We've discussed that in the past.  "Choose at runtime" is a bit more
easily said than done though --- you can't readily flip between plan
choices part way through, if you've already emitted some result rows.

			regards, tom lane



view thread (26+ messages)  latest in thread

Message-ID: <355.1236705647@sss.pgh.pa.us>
Permalink:  ../355.1236705647@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/355.1236705647@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, fche@redhat.com, mario.splivalo@megafon.hr
  Subject: Re: Query much slower when run from postgres function
  In-Reply-To: <355.1236705647@sss.pgh.pa.us>

* 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