From: Gerhard Wiesinger <lists@wiesinger.com>
To: Andreas Kretschmer <akretschmer@spamfence.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
Date: Mon, 30 Aug 2010 09:48:14 +0200 (CEST)
Message-ID: <alpine.LFD.2.01.1008300941220.17348@bbs.intern> (raw)
In-Reply-To: <20100830072230.GA28373@tux>
References: <alpine.LFD.2.01.1008300802300.4121@bbs.intern>
<20100830072230.GA28373@tux>
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/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: lists@wiesinger.com, akretschmer@spamfence.net
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
In-Reply-To: <alpine.LFD.2.01.1008300941220.17348@bbs.intern>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox