pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Kretschmer <akretschmer@spamfence.net>
To: pgsql-performance@postgresql.org
Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
Date: Mon, 30 Aug 2010 09:22:30 +0200
Message-ID: <20100830072230.GA28373@tux> (raw)
In-Reply-To: <alpine.LFD.2.01.1008300802300.4121@bbs.intern>
References: <alpine.LFD.2.01.1008300802300.4121@bbs.intern>

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?

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;


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



Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



view thread (39+ messages)  latest in thread

Message-ID: <20100830072230.GA28373@tux>
Permalink:  ../20100830072230.GA28373@tux/
Also on:    postgresql.org/message-id/20100830072230.GA28373@tux

 · 

reply

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: akretschmer@spamfence.net
  Subject: Re: Major performance problem after upgrade from 8.3 to 8.4
  In-Reply-To: <20100830072230.GA28373@tux>

* 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