From: Rod Taylor <rbt@rbt.ca>
To: Mark Bronnimann <meb@speakeasy.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: function returning setof performance question
Date: 29 Jul 2003 22:28:19 -0400
Message-ID: <1059532098.54325.23.camel@jester> (raw)
In-Reply-To: <20030730020859.GA1795@spiff.astoria.bogus>
References: <20030730020859.GA1795@spiff.astoria.bogus>
> The performance hit is tiny, we're talking less than 1/2 a second,
> but when I've done this sort of thing in Oracle I've seen a performance
> increase, not a decrease.
Thats just plain strange (never tried on Oracle). Why in the world
would adding the overhead of a function call (with no other changes)
increase performance?
The function has additional overhead in the form of the plpgsql
interpreter. You may find a c function will give close to identical
performance as with the standard view so long as the query is the same.
One thing to keep in mind is that the view can be rearranged to give a
better query overall. The exact work completed for the view may be
different when called from within a different SQL statement. Most
functions -- some SQL language based functions are strange this way --
cannot do this
Attachments:
signature.asc (application/pgp-signature, 186B) download
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: rbt@rbt.ca, meb@speakeasy.net
Subject: Re: function returning setof performance question
In-Reply-To: <1059532098.54325.23.camel@jester>
* 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