Re: Performance bug in prepared statement binding in 9.2?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance bug in prepared statement binding in 9.2?
Date: 2013-05-30 18:06:10
Message-ID: 51A79512.4020200@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Amit,

> I think it might be because of choosing custom plan option due to which it might be generating new plan during exec_bind_message().
> exec_bind_message()->GetCachedPlan()->choose_custom_plan(). If it chooses custom plan, then it will regenerate the plan which can cause extra cost
> observed in test.
> Though there is calculation that it should not choose custom plan always, but still I guess the variation observed in the test can be due to this reason.

This is why I'm asking them to run tests on 9.1. If 9.1 doesn't exhibit
this behavior, then customplan is liable to be at fault.

HOWEVER, that doesn't explain why creating a plan for a query during
application operation would take 80ms, but only 1.2ms when I do it
interactively.

FYI, per questions from IRC: the times for each "cycle" in my data are
cumulative minutes. Each cycle runs around 500,000 queries, so that's
the aggregate across all queries.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2013-05-30 20:18:44 Re: Performance bug in prepared statement binding in 9.2?
Previous Message Merlin Moncure 2013-05-30 15:59:07 Re: Slow SELECT by primary key? Postgres 9.1.2