Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by postgresql.org (Postfix) with SMTP id 3BD72475CCA for ; Fri, 12 Apr 2002 14:12:15 -0400 (EDT) Received: from psc.progress.com (HELO saturn.janwieck.net) (janwieck@192.233.92.200 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 12 Apr 2002 18:12:14 -0000 Received: (from wieck@localhost) by saturn.janwieck.net (8.11.2/8.11.2) id g3CI7W407276; Fri, 12 Apr 2002 14:07:32 -0400 From: Jan Wieck Message-Id: <200204121807.g3CI7W407276@saturn.janwieck.net> Subject: Re: Functions in Postgres In-Reply-To: from Peter Eisentraut at "Apr 12, 2002 12:24:33 pm" To: Peter Eisentraut Date: Fri, 12 Apr 2002 14:07:32 -0400 (EDT) Cc: Gordon Clarke , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/157 X-Sequence-Number: 7421 Peter Eisentraut wrote: > Gordon Clarke writes: > > > I was asking to see if there was any speed penalty with coding a fn in SQL > > as opposed to PL/pgsql. It appears that there is and from what you've said > > PL/pgsql is slightly faster than PL/TCL and probably PL/Perl. Am I correct > > in drawing that conclusion? > > Yes, that seems about right. I would say it depends pretty much on what that function is doing. PL/pgSQL is not the best answer to do string manipulation and such. PL/Tcl can do that alot better, Tcl has it's own bytecode compiler since 8.0 (if memory serves), and if the programmer cares, it can cache query plans as well. As allways a) Using the right tool for a problem can lead to good results. b) A fool with a tool is still a fool. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #