Re: 8.4b1 regression? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 8.4b1 regression?
Date
Msg-id 13010.1240454874@sss.pgh.pa.us
Whole thread Raw
In response to 8.4b1 regression?  ("Eric B. Ridge" <ebr@tcdi.com>)
Responses Re: 8.4b1 regression?  ("Eric B. Ridge" <ebr@tcdi.com>)
List pgsql-hackers
"Eric B. Ridge" <ebr@tcdi.com> writes:
> I loaded a copy of a production database into PG 8.4b1 and immediately  
> saw that all of our queries were significantly slower compared to v8.1.

> Some investigation showed that the use of non-IMMUTABLE PL/PGSQL  
> functions as view columns, when these views are joined with other  
> views, cause the query to be planned poorly.

I think this is due to a change that was made in 8.2:
   * Do not flatten subqueries that contain volatile functions in their     target lists (Jaime Casanova)
       This prevents surprising behavior due to multiple evaluation of a       volatile function (such as random() or
nextval()).It might cause       performance degradation in the presence of functions that are       unnecessarily
markedas volatile.
 

The pre-8.2 behavior was unduly optimistic about the safety of
rearranging calls to volatile functions.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Prepared transactions vs novice DBAs, again
Next
From: Tom Lane
Date:
Subject: Re: Prepared transactions vs novice DBAs, again