[PERFORM] Stable function optimisation

2007-08-17 Thread Philipp Specht
Hello! Here's my test database: # table CREATE TABLE public.t ( id integer NOT NULL, a integer NOT NULL, CONSTRAINT pk_t PRIMARY KEY (id) ) CREATE INDEX idx_t_a ON public.t USING btree (a); # function CREATE OR REPLACE FUNCTION public.f() RETURNS integer AS $BODY$BEGIN RET

Re: [PERFORM] Stable function optimisation

2007-08-15 Thread Philipp Specht
Hi Tom, Thank you very much for your explanation. On 13.08.2007, at 23:01, Tom Lane wrote: Philipp Specht <[EMAIL PROTECTED]> writes: The biggest question here is: Why is the runtime of the query with the stable function not near the runtime of the immutable function? Stable fun

[PERFORM] Stable function optimisation

2007-08-13 Thread Philipp Specht
Hello! Here's my test database: # table CREATE TABLE public.t ( id integer NOT NULL, a integer NOT NULL, CONSTRAINT pk_t PRIMARY KEY (id) ) CREATE INDEX idx_t_a ON public.t USING btree (a); # function CREATE OR REPLACE FUNCTION public.f() RETURNS integer AS $BODY$BEGIN RET