Re: Major performance problem after upgrade from 8.3 to 8.4

From: Gerhard Wiesinger <lists(at)wiesinger(dot)com>
To: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
Date: 2010-08-30 07:48:14
Message-ID: alpine.LFD.2.01.1008300941220.17348@bbs.intern
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, 30 Aug 2010, Andreas Kretschmer wrote:

> Gerhard Wiesinger <lists(at)wiesinger(dot)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/

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Gerhard Wiesinger 2010-08-30 07:56:24 Re: Major performance problem after upgrade from 8.3 to 8.4
Previous Message Pavel Stehule 2010-08-30 07:34:36 Re: Major performance problem after upgrade from 8.3 to 8.4