Re: Prepared statements and suboptimal plans

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andy Lester <andy(at)petdance(dot)com>
Cc: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, Royce Ausburn <royce(dot)ml(at)inomial(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Prepared statements and suboptimal plans
Date: 2011-09-21 01:00:32
Message-ID: 10687.1316566832@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Andy Lester <andy(at)petdance(dot)com> writes:
> On Sep 20, 2011, at 7:36 PM, Tom Lane wrote:
>> 9.2, sorry, not 9.1. We could use some motivated people testing that
>> aspect of GIT HEAD, though, since I doubt the policy for when to re-plan
>> is quite ideal yet.

> Is motivation and a box enough? I have motivation, but not knowledge of internals enough to drive testing myself.

Well, you probably don't need much internals knowledge as long as you
can read a little C. The crux of what I'm worried about is
choose_custom_plan() in src/backend/utils/cache/plancache.c, which is
really pretty simple: decide whether to use a custom (parameter-aware)
plan or a generic (not-parameter-aware) plan. You might want to shove
some elog() calls in there for tracing purposes so that you can log what
it did, but then it's just a matter of throwing real-world workloads at
it and seeing if it makes good decisions.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephen Frost 2011-09-21 02:36:15 Re: Prepared statements and suboptimal plans
Previous Message Andy Lester 2011-09-21 00:42:41 Re: Prepared statements and suboptimal plans