pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Timbo Chen <timbo@powerreviews.com>
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: parameterized query much much slower than one with hard-coded string
Date: Thu, 10 Nov 2011 10:10:23 -0500
Message-ID: <7810.1320937823@sss.pgh.pa.us> (raw)
In-Reply-To: <CAOerExAU5NRQH-YVkUoPPz+LniyyqYTNSFCs6KqmJMaoTRq-eg@mail.gmail.com>
References: <CAOerExCvo_6n-yDR+ni-hXXADTDbEhzuqzGHinHHaWuZu_jSxw@mail.gmail.com>
	<CA+0W9LOU1jb=ngTEDY7g5g49RsgR6fd+yGAkahxzBpqBH7n01Q@mail.gmail.com>
	<CAOerExAU5NRQH-YVkUoPPz+LniyyqYTNSFCs6KqmJMaoTRq-eg@mail.gmail.com>

Timbo Chen <timbo@powerreviews.com> writes:
> just wondering if there was a way to get the execution plan for the
> prepared statement.

Prepare an equivalently-parameterized statement by hand:

PREPARE foo(int,text,...) AS ...

and then do EXPLAIN [ANALYZE] EXECUTE foo(...)

			regards, tom lane



view thread (5+ messages)

Message-ID: <7810.1320937823@sss.pgh.pa.us>
Permalink:  ../7810.1320937823@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7810.1320937823@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, timbo@powerreviews.com, oliver@opencloud.com
  Subject: Re: parameterized query much much slower than one with hard-coded string
  In-Reply-To: <7810.1320937823@sss.pgh.pa.us>
  References: <CAOerExCvo_6n-yDR+ni-hXXADTDbEhzuqzGHinHHaWuZu_jSxw@mail.gmail.com> <CA+0W9LOU1jb=ngTEDY7g5g49RsgR6fd+yGAkahxzBpqBH7n01Q@mail.gmail.com> <CAOerExAU5NRQH-YVkUoPPz+LniyyqYTNSFCs6KqmJMaoTRq-eg@mail.gmail.com> <7810.1320937823@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