Skip site navigation (1) Skip section navigation (2)

Re: How to improve: performance of query on postgresql 8.3 takes days

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Dino Vliet <dino_vliet(at)yahoo(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: How to improve: performance of query on postgresql 8.3 takes days
Date: 2010-07-30 10:48:31
Message-ID: 33253F43-DA25-40DA-A97D-25AC09AC4AC3@solfertje.student.utwente.nl (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-performance
On 29 Jul 2010, at 23:58, Dino Vliet wrote:

> CREATE OR REPLACE FUNCTION agenttype1(a character)
> RETURNS integer AS

> LANGUAGE 'plpgsql' VOLATILE
> COST 100;
> 
> 
> CREATE OR REPLACE FUNCTION agenttype2(a character)
> RETURNS integer AS

> LANGUAGE 'plpgsql' VOLATILE
> COST 100;
> 
> 
> CREATE OR REPLACE FUNCTION agenttype3(a character)
> RETURNS integer AS

> LANGUAGE 'plpgsql' VOLATILE
> COST 100;

As others have already said, using these functions will be less efficient than using joins. 

Regardless of that though, you should at least declare these functions as STABLE instead of VOLATILE, see:

http://www.postgresql.org/docs/8.4/interactive/xfunc-volatility.html

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4c52ae01286211819977167!



In response to

pgsql-performance by date

Next:From: Greg StarkDate: 2010-07-30 10:49:37
Subject: Re: On Scalability
Previous:From: Vincenzo RomanoDate: 2010-07-30 10:24:10
Subject: Re: On Scalability

pgsql-general by date

Next:From: KanandaDate: 2010-07-30 11:58:10
Subject: RES: [GENERAL] PostgreSQL keepalives help
Previous:From: Alban HertroysDate: 2010-07-30 10:31:29
Subject: Re: Which CMS/Ecommerce/Shopping cart ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group