pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Thomas Finneid <tfinneid@fcon.no>
Cc: John Lister <john.lister@kickstone.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: pooled prepared statements
Date: Wed, 13 May 2009 18:31:03 -0400
Message-ID: <491f66a50905131531x774b2a3ds7813b075562cd83f@mail.gmail.com> (raw)
In-Reply-To: <4A0B24E3.3070301@fcon.no>
References: <4A0978A3.6030900@fcon.no>
	<4A099C8F.60709@kickstone.com>
	<4A09C4E6.3010408@fcon.no>
	<4A09D04B.9070206@kickstone.com>
	<4A0A7D50.40704@fcon.no>
	<03C41048CEFD45DD97AC0DD884C8A21A@squarepi.com>
	<491f66a50905130821j6afa056fp947e4dbcfd09d701@mail.gmail.com>
	<4A0B24E3.3070301@fcon.no>

I still think you will have multiple prepared statements one per connection
regardless of if it uses a procedure, and you would have to prepare the
statement on first use and then store it in the session.

Dave

On Wed, May 13, 2009 at 3:52 PM, Thomas Finneid <tfinneid@fcon.no> wrote:

>
> Maybe your right. The query processing takes from 1-10 seconds, so planning
> it is not a big factor. But when the load becomes higher, as it will be as
> the data increases, the planning might possibly eat time which could be used
> elsewhere.
>
> My server, as it is now, is pushing the limits of postgres for my use, so
> maybe I need to reclaim as much of wasted time as possible...
>
> We'll see.
>
> thomas
>
> Dave Cramer wrote:
>
>
>>
>> On Wed, May 13, 2009 at 10:37 AM, John Lister <john.lister@kickstone.com<mailto:
>> john.lister@kickstone.com>> wrote:
>>
>>                Probably easier to create a server side function
>>                instead, then.
>>
>>            But wouldn't you still have to go through all the planning
>>            steps within the function for any queries, although i'll
>>            admit i'm not familiar with Postgresql functions.
>>
>>
>>        Server-side functions are compiled when installed. Since my
>>        function would only contain simple queries that are
>>        parameterized, it would pre-compile well.
>>
>>
>> While the function may be compiled, the overhead is the same for preparing
>> the statement inside the function. So I don't think it's a huge win.
>>
>>
>

view thread (13+ messages)  latest in thread

Message-ID: <491f66a50905131531x774b2a3ds7813b075562cd83f@mail.gmail.com>
Permalink:  ../491f66a50905131531x774b2a3ds7813b075562cd83f@mail.gmail.com/
Also on:    postgresql.org/message-id/491f66a50905131531x774b2a3ds7813b075562cd83f@mail.gmail.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 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: pg@fastcrypt.com, tfinneid@fcon.no, john.lister@kickstone.com
  Subject: Re: pooled prepared statements
  In-Reply-To: <491f66a50905131531x774b2a3ds7813b075562cd83f@mail.gmail.com>
  References: <4A0978A3.6030900@fcon.no> <4A099C8F.60709@kickstone.com> <4A09C4E6.3010408@fcon.no> <4A09D04B.9070206@kickstone.com> <4A0A7D50.40704@fcon.no> <03C41048CEFD45DD97AC0DD884C8A21A@squarepi.com> <491f66a50905130821j6afa056fp947e4dbcfd09d701@mail.gmail.com> <4A0B24E3.3070301@fcon.no> <491f66a50905131531x774b2a3ds7813b075562cd83f@mail.gmail.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