X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1E4B8DAA57 for ; Wed, 26 Oct 2005 06:48:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18836-04 for ; Wed, 26 Oct 2005 09:48:38 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id 93397DA9B5 for ; Wed, 26 Oct 2005 06:48:39 -0300 (ADT) Received: from localhost (av.hub.org [200.46.204.144]) by hub.org (Postfix) with ESMTP id 653EBA246B3 for ; Wed, 26 Oct 2005 06:48:39 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20920-03; Wed, 26 Oct 2005 09:48:35 +0000 (GMT) Received: from ganymede.hub.org (blk-222-82-85.eastlink.ca [24.222.82.85]) by hub.org (Postfix) with ESMTP id F1326A246AD; Wed, 26 Oct 2005 06:48:36 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id C55D93C115; Wed, 26 Oct 2005 06:48:42 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 99A01354B6; Wed, 26 Oct 2005 06:48:42 -0300 (ADT) Date: Wed, 26 Oct 2005 06:48:41 -0300 (ADT) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: Michael Fuhr Cc: pgsql-sql@postgresql.org Subject: Re: pl/* overhead ... In-Reply-To: <20051026065542.GA19386@winnie.fuhr.org> Message-ID: <20051026064246.Q993@ganymede.hub.org> References: <20051026005729.V993@ganymede.hub.org> <20051026065542.GA19386@winnie.fuhr.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.329 required=5 tests=[AWL=0.279, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/318 X-Sequence-Number: 23171 On Wed, 26 Oct 2005, Michael Fuhr wrote: > On Wed, Oct 26, 2005 at 12:58:13AM -0300, Marc G. Fournier wrote: >> Does anyone know of, or have, any comparisions of the overhead going with >> something like pl/perl or pl/php vs using pl/pgsql? > > Benchmark results will probably depend on the type of processing > you're doing. I'd expect PL/pgSQL to be faster at database operations > like looping through query results, and other languages to be faster > at non-database operations like text munging and number crunching, > depending on the particular language's strengths. > > [Does quick test.] > > Whale oil beef hooked. PL/pgSQL just outran PL/Perl when I expected > the latter to win. Hang on, let me play with it until it comes back > with the results I want.... 'k, let's repharase the questions :) Overall, I'd expect pl/pgsql to have less overhead, since its "built into" the server ... in the case of something like pl/php or pl/perl, assuming that I don't use any external modules, is it just as 'built in', or am I effectively calling an external interpreter each time I run that function? For instance, if there wasn't something like to_char() (thanks for pointing that one out), then i could write a simple pl/perl function that 'simulated it', but itself did no db queries just a simple: RETURN sprintf("%04d", intval); Don't know if that made much more sense ... ? ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664