pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: josh@agliodbs.com
Cc: Richard Huxton <dev@archonet.com>
Cc: Michael Pohl <pgsql@newtopia.com>
Cc: pgsql-sql@postgresql.org, "George A.J" <jinujosein@yahoo.com>
Subject: Re: Which is faster SQL or PL/PGSQL
Date: Mon, 20 Oct 2003 11:54:42 -0700
Message-ID: <3F942F72.6050709@joeconway.com> (raw)
In-Reply-To: <200310201124.02090.josh@agliodbs.com>
References: <Pine.LNX.4.44.0310201119240.10378-100000@server1.techplant.com>
	<200310201849.19668.dev@archonet.com>
	<3F942558.2000804@joeconway.com>
	<200310201124.02090.josh@agliodbs.com>

Josh Berkus wrote:
>>Yes, I believe so (well, actually the optimizer). An inlined SQL 
>>function ends up behaving like a macro that expands at run time and is 
>>therefore quite fast -- no function call overhead at all.
> 
> ... but only in 7.4.   In 7.2 and I think in 7.3 this was not implemented.

Yeah, that's what my original post said ;-)

> While we're on the topic, anyone know any good ways to speed up EXECUTE 
> statements in PL/pgSQL functions?

Never tried it, but is it possible to use a prepared statement inside a 
PL/pgSQL function? In any case, you can in other PLs. And with library 
preloading (starting in 7.4), the first call to other PLs is similar to 
that of PL/pgSQL. See:
   http://archives.postgresql.org/pgsql-patches/2003-07/msg00239.php

Joe




view thread (13+ messages)  latest in thread

Message-ID: <3F942F72.6050709@joeconway.com>
Permalink:  ../3F942F72.6050709@joeconway.com/
Also on:    postgresql.org/message-id/3F942F72.6050709@joeconway.com

 · 

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-sql@postgresql.org
  Cc: mail@joeconway.com, josh@agliodbs.com, dev@archonet.com, pgsql@newtopia.com, jinujosein@yahoo.com
  Subject: Re: Which is faster SQL or PL/PGSQL
  In-Reply-To: <3F942F72.6050709@joeconway.com>

* 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