pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: PFC <lists@peufeu.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: PREPARE and stuff
Date: Sat, 23 Jun 2007 22:51:00 +0100
Message-ID: <467D95C4.4020407@enterprisedb.com> (raw)
In-Reply-To: <op.tud8ogmscigqcu@apollo13>
References: <op.tud8ogmscigqcu@apollo13>

PFC wrote:
> 
>     Suppose a web application with persistent database connections.
>     I have some queries which take longer to plan than to execute !
> 
>     I with there was a way to issue a PREPARE (like "PERSISTENT PREPARE").
>     Now all Postgres connections would know that prepared statement foo( 
> $1, $2, $3 ) corresponds to some SQL query, but it wouldn't plan it yet. 
> Just like a SQL function.
>     When invoking EXECUTE foo( 1,2,3 ) on any given connection the 
> statement would get prepared and planned. Then on subsequent invocations 
> I'd just get the previously prepared plan.

How would that be different from the current PREPARE/EXECUTE? Do you 
mean you could PREPARE in one connection, and EXECUTE in another? If 
you're using persistent connections, it wouldn't be any faster than 
doing a PREPARE once in each connection.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (5+ messages)  latest in thread

Message-ID: <467D95C4.4020407@enterprisedb.com>
Permalink:  ../467D95C4.4020407@enterprisedb.com/
Also on:    postgresql.org/message-id/467D95C4.4020407@enterprisedb.com

 · 

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: heikki@enterprisedb.com, lists@peufeu.com
  Subject: Re: PREPARE and stuff
  In-Reply-To: <467D95C4.4020407@enterprisedb.com>

* 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