| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | "Eric B(dot) Ridge" <ebr(at)tcdi(dot)com> |
| Cc: | hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: 8.4b1 regression? |
| Date: | 2009-04-23 02:47:54 |
| Message-ID: | 13010.1240454874@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
"Eric B. Ridge" <ebr(at)tcdi(dot)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 marked as volatile.
The pre-8.2 behavior was unduly optimistic about the safety of
rearranging calls to volatile functions.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2009-04-23 03:04:41 | Re: Prepared transactions vs novice DBAs, again |
| Previous Message | Robert Haas | 2009-04-23 02:14:07 | Re: Prepared transactions vs novice DBAs, again |