pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rikard Pavelic <rikard.pavelic@zg.htnet.hr>
To: pgsql-performance@postgresql.org
Subject: Re: [PERFORMANCE] Stored Procedures
Date: Fri, 20 Jan 2006 20:38:23 +0100
Message-ID: <43D13C2F.1030203@zg.htnet.hr> (raw)
In-Reply-To: <20060120191031.GO20182@pervasive.com>
References: <43D130EF.3010205@zg.htnet.hr>
	<20060120191031.GO20182@pervasive.com>

Jim C. Nasby wrote:
> My college professor said it, it must be true! ;P
>
>   
The famous joke ;)
> My understanding is that in plpgsql, 'bare' queries get prepared and act
> like prepared statements. IE:
>
> SELECT INTO variable
>     field
>     FROM table
>     WHERE condition = true
> ;
>
>   
Unfortunately I don't know enough about PostgreSQL, but from responses 
I've been reading I've
come to that conclusion.
> Ok, so post some numbers then. It might be interesting to look at the
> cost of preparing a statement, although AFAIK that does not store the
> query plan anywhere.
>
> In most databases, query planning seems to be a pretty expensive
> operation. My experience is that that isn't the case with PostgreSQL.
>   

I didn't think about storing query plan anywhere on the disk, rather 
keep them in memory pool.
It would be great if we had an option to use prepare statement for 
stored procedure so it
would prepare it self the first time it's called and remained prepared 
until server shutdown or
memory pool overflow.

This would solve problems with prepare which is per session, so for 
prepared function to be
optimal one must use same connection.



view thread (14+ messages)  latest in thread

Message-ID: <43D13C2F.1030203@zg.htnet.hr>
Permalink:  ../43D13C2F.1030203@zg.htnet.hr/
Also on:    postgresql.org/message-id/43D13C2F.1030203@zg.htnet.hr

 · 

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: rikard.pavelic@zg.htnet.hr
  Subject: Re: [PERFORMANCE] Stored Procedures
  In-Reply-To: <43D13C2F.1030203@zg.htnet.hr>

* 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