Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 3BB4F63226D for ; Mon, 30 Aug 2010 04:49:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 31183-10 for ; Mon, 30 Aug 2010 07:49:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fep13.mx.upcmail.net (fep13.mx.upcmail.net [62.179.121.33]) by mail.postgresql.org (Postfix) with ESMTP id C02F1632AA3 for ; Mon, 30 Aug 2010 04:49:16 -0300 (ADT) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep13-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100830074913.KGEN1353.viefep13-int.chello.at@edge03.upcmail.net> for ; Mon, 30 Aug 2010 09:49:13 +0200 Received: from wiesinger.com ([84.112.167.138]) by edge03.upcmail.net with edge id 0Xp61f05k2zVakc03Xp7DL; Mon, 30 Aug 2010 09:49:10 +0200 X-SourceIP: 84.112.167.138 Received: from bbs.intern (localhost [127.0.0.1]) by wiesinger.com (8.14.4/8.14.4) with ESMTP id o7U7mF56019579; Mon, 30 Aug 2010 09:48:15 +0200 Received: from localhost (gerhard@localhost) by bbs.intern (8.14.4/8.14.4/Submit) with ESMTP id o7U7mEra019575; Mon, 30 Aug 2010 09:48:14 +0200 Date: Mon, 30 Aug 2010 09:48:14 +0200 (CEST) From: Gerhard Wiesinger To: Andreas Kretschmer cc: pgsql-performance@postgresql.org Subject: Re: Major performance problem after upgrade from 8.3 to 8.4 In-Reply-To: <20100830072230.GA28373@tux> Message-ID: References: <20100830072230.GA28373@tux> User-Agent: Alpine 2.01 (LFD 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-MailScanner-Information-wiesinger-com: Please contact the ISP for more information X-wiesinger-com-MailScanner-ID: o7U7mF56019579 X-MailScanner-wiesinger-com: Found to be clean X-MailScanner-SpamCheck-wiesinger-com: not spam, SpamAssassin (not cached, score=-4.399, required 4.5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-MailScanner-From: lists@wiesinger.com X-Cloudmark-Analysis: v=1.1 cv=V15LrGZDFsIOLQGhFSBQucROxfiwgIeIJ7AmZ+xKGd4= c=1 sm=0 a=-BBt41PQAQkA:10 a=ORa4HqFjfvEA:10 a=kj9zAlcOel0A:10 a=-ProOGmuAAAA:8 a=08AciPDXAAAA:8 a=EHnOIZKp1fQY9SQlP6AA:9 a=RjMq9HCaLbTnpkaKSp5btGOJBHwA:4 a=CjuIK1q_8ugA:10 a=9vkYYwwqn38A:10 a=fU-A4pz3-wIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201008/314 X-Sequence-Number: 40157 On Mon, 30 Aug 2010, Andreas Kretschmer wrote: > Gerhard Wiesinger 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/