Re: Important speed difference between a query and a function with the same query - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: Important speed difference between a query and a function with the same query
Date
Msg-id 20030425100905.D66185@flake.decibel.org
Whole thread Raw
In response to Important speed difference between a query and a function with the same query  (Frederic Jolliton <fred-pg@jolliton.com>)
List pgsql-performance
On Wed, Apr 23, 2003 at 07:53:55PM +0200, Frederic Jolliton wrote:
> CREATE FUNCTION get_info (integer) RETURNS SETOF type_get_info
>     AS '...' <- here the query show below, where 'LIMIT $1' is used instead of 'LIMIT 10'
>     LANGUAGE sql;

You should probably define the function to be STABLE.

     LANGUAGE sql STABLE;

See
http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=sql-createfunction.html
for more info.
--
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: More tablescanning fun
Next
From: Hannu Krosing
Date:
Subject: Re: More tablescanning fun