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

Re: STABLE functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joachim Wieland <jwieland(at)kawo2(dot)rwth-aachen(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: STABLE functions
Date: 2003-04-25 14:01:44
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers
Joachim Wieland <jwieland(at)kawo2(dot)rwth-aachen(dot)de> writes:
> I'm using 7.3.2 and encounter the problem that a SELECT query that uses
> a function with a constant argument is quite slow. The function is
> declared STABLE. Here's an example:

> SELECT ... FROM table WHERE col = f('xyz');

>> From what I read in the docs

> ( )

> I thought that this function is only executed once when declared as

You are mistaken.

If you'd declared it IMMUTABLE, then it would get constant-folded, but
that may or may not be suitable for your purpose.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2003-04-25 14:10:23
Subject: Re: close() vs. closesocket()
Previous:From: mlwDate: 2003-04-25 12:29:29
Subject: Re: close() vs. closesocket()

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