Re: Huge difference in query performance between 8.3 and 8.4 (possibly)

From: "Hartman, Matthew" <Matthew(dot)Hartman(at)krcc(dot)on(dot)ca>
To: "Robin Houston" <robin(dot)houston(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Huge difference in query performance between 8.3 and 8.4 (possibly)
Date: 2009-07-09 17:36:00
Message-ID: 366642367C5B354197A1E0D27BC175BD0225987D@KGHMAIL.KGH.ON.CA
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> From: pgsql-performance-owner(at)postgresql(dot)org
[mailto:pgsql-performance-
> owner(at)postgresql(dot)org] On Behalf Of Robin Houston
> Sent: Thursday, July 09, 2009 12:35 PM

> We have a query that runs very slowly on our 8.3 database. (I can't
> tell you exactly how slowly, because it has never successfully run to
> completion even when we left it running overnight.) On the 8.4
> database on my laptop, it runs in about 90 seconds.
> Any insights would be much appreciated.

I doubt this is the insight you're looking for, but that is the worst
query I have ever seen. It is difficult to understand exactly what it
returns. There are so many cross joins, outer joins, and inner joins
mixed up together, ugh.

Rather than trying to puzzle out why it is slow, rewrite it. It will be
faster than before on any version.

Matthew Hartman
Programmer/Analyst
Information Management, ICP
Kingston General Hospital

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message hubert depesz lubaczewski 2009-07-09 18:11:09 Re: Sorting by an arbitrary criterion
Previous Message Tom Lane 2009-07-09 17:09:11 Re: Huge difference in query performance between 8.3 and 8.4 (possibly)