X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 92A2A11F6311 for ; Tue, 11 Apr 2006 11:02:38 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 required=5 tests=[none] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id x0ZpsFoaqe0m for ; Tue, 11 Apr 2006 11:02:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from michael.eatserver.nl (michael.eatserver.nl [212.203.14.103]) by postgresql.org (Postfix) with ESMTP id C781411F638E for ; Tue, 11 Apr 2006 11:02:34 -0300 (ADT) Received: from dvipc (82-170-251-187.dsl.ip.tiscali.nl [82.170.251.187]) (authenticated bits=0) by michael.eatserver.nl (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id k3BE2Wfv001561; Tue, 11 Apr 2006 16:02:32 +0200 From: "H.J. Sanders" To: "Merlin Moncure" , "Simon Dale" Cc: Subject: Re: Stored Procedure Performance Date: Tue, 11 Apr 2006 16:02:51 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: Importance: Normal X-Virus-Scanned: by amavisd-new X-Archive-Number: 200604/237 X-Sequence-Number: 18321 Hello At my little machine (pentium 4, 2.8 Ghz, 256 Mb RAM, Suse linux 9) I can process about 100000 records a minute using the next setup: begin work begin for processing if 10.000 records processed: commit work begin work end if end for commit work (!) Regards Henk Sanders > -----Oorspronkelijk bericht----- > Van: pgsql-performance-owner@postgresql.org > [mailto:pgsql-performance-owner@postgresql.org]Namens Merlin Moncure > Verzonden: dinsdag 11 april 2006 15:50 > Aan: Simon Dale > CC: pgsql-performance@postgresql.org > Onderwerp: Re: [PERFORM] Stored Procedure Performance > > > On 4/11/06, Simon Dale wrote: > > I'm trying to evaluate PostgreSQL as a database that will have to store a > > high volume of data and access that data frequently. One of the features on > > our wish list is to be able to use stored procedures to access the data and > > I was wondering if it is usual for stored procedures to perform slower on > > PostgreSQL than raw SQL? > > pl/pgsql procedures are a very thin layer over the query engine. > Generally, they run about the same speed as SQL but you are not making > apples to apples comparison. One of the few but annoying limitations > of pl/pgsql procedures is that you can't return a select directly from > the query engine but have to go through the return/return next > paradigm which will be slower than raw query for obvious reasons. > > You can however return a refcursor and you may want to look at them in > situations where you want to return arbitrary sets outside the query > engine or between pl/pgsql functions. An example of using refcurors > in that way is on my blog at > http://people.planetpostgresql.org/merlin/index.php?/archives/2-Dealing-With-Recursive-Sets-With-PLPGSQL.html > > Generally, in my opinion if you want to really unlock the power of > postgresql you have to master pl/pgsql. Go for it...it will work and > work well. > > merlin > > merlin > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >