Re: Major performance problem after upgrade from 8.3 to 8.4 - Mailing list pgsql-performance

From Gerhard Wiesinger
Subject Re: Major performance problem after upgrade from 8.3 to 8.4
Date
Msg-id alpine.LFD.2.01.1008300941220.17348@bbs.intern
Whole thread Raw
In response to Re: Major performance problem after upgrade from 8.3 to 8.4  (Andreas Kretschmer <akretschmer@spamfence.net>)
List pgsql-performance
On Mon, 30 Aug 2010, Andreas Kretschmer wrote:

> Gerhard Wiesinger <lists@wiesinger.com> wrote:
>
>> I know that the data model is key/value pairs but it worked well in 8.3.
>> I need this flexibility.
>>
>> Any ideas?
>
> If i understand the query correctly it's a pivot-table, right?
>

The view flattens the key/value structure (for enchanceable technical
measure values) to a flat structure with many columns. The view is that I
have a flat structure and then have easy to write queries for aggregation.

The query itself is just an aggregating query over that flat structure.

Any ideas for better optimizations?

> If yes, and if i where you, i would try to rewrite this query, to
> something like:
>
> select
>  timestamp,
>  sum (case when keyid = 1 then value else 0 end) as Raumsolltemperatur,
>  ...
> from
>  log
> group by
>  timestamp;
>

I will try that. But what I don't understand: query was really fast in
8.3 even with 24 hours timeframe.

>
> Assuming you can read a german text:
> http://www.pg-forum.de/h-ufig-gestellte-fragen-faq/4067-faq-zeilen-zu-spalten.html

Hopefully yes :-) after that Fedora/Postgresql nightmare update night
(Parallel Fedora upgrade stalled whole machine since that query from
Nagios was executed I guess hundreds of times since it got very slow in
8.4). Machine was pingable but nothing else even on console :-( RAID
rebuild and all other stuff :-(

I planned the upgrade but I didn't expect problems with the query plan
instability :-(

Thnx.

Ciao,
Gerhard

--
http://www.wiesinger.com/

pgsql-performance by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
Next
From: Yeb Havinga
Date:
Subject: Re: Performance on new 64bit server compared to my 32bit desktop