pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tobias Brox <tobias@nordicbet.com>
To: Oliver Crosby <ryusei@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Prepared statements vs. Stored Procedures
Date: Tue, 21 Jun 2005 22:40:57 +0200
Message-ID: <20050621204057.GI22746@oppetid.no> (raw)
In-Reply-To: <1efd553a05062112462c30e9ff@mail.gmail.com>
References: <1efd553a05062112462c30e9ff@mail.gmail.com>

[Oliver Crosby - Tue at 03:46:03PM -0400]
> I'm hoping someone can offer some advice here.
>  I have a large perl script that employs prepared statements to do all its 
> queries. I'm looking at using stored procedures to improve performance times 
> for the script. Would making a stored procedure to replace each prepared 
> statement be worthwhile? If not, when could I use stored procedures to 
> improve performance?
>  Thanks in advance.

My gut feeling says that if you are only doing read-operations there are
none or almost none benefits with stored procedures.

One argument we used for not looking much into stored procedures, was
that we expect the database to become the bottleneck if we get too much
activity.  At the application side, we can always expand by adding more
boxes, but the database, beeing the hub of the system, cannot easily be
expanded (we can tweak and tune and upgrade the whole box, and
eventually at some point we believe we will need to put old data at a
separate database, and also make a replica for heavy report queries)

If you have loads of data going from the database to the application, a
little bit of light processing done on the data, and then data going
back to the database server, then I guess stored procedures would be
better.



view thread (3+ messages)  latest in thread

Message-ID: <20050621204057.GI22746@oppetid.no>
Permalink:  ../20050621204057.GI22746@oppetid.no/
Also on:    postgresql.org/message-id/20050621204057.GI22746@oppetid.no

 · 

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: tobias@nordicbet.com, ryusei@gmail.com
  Subject: Re: Prepared statements vs. Stored Procedures
  In-Reply-To: <20050621204057.GI22746@oppetid.no>

* 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