Re: Major performance problem after upgrade from 8.3 to 8.4

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: Major performance problem after upgrade from 8.3 to 8.4
Дата
Msg-id 20100830072230.GA28373@tux
обсуждение исходный текст
Ответ на Major performance problem after upgrade from 8.3 to 8.4  (Gerhard Wiesinger <lists@wiesinger.com>)
Ответы Re: Major performance problem after upgrade from 8.3 to 8.4  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Major performance problem after upgrade from 8.3 to 8.4  (Gerhard Wiesinger <lists@wiesinger.com>)
Список pgsql-performance
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°

В списке pgsql-performance по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Major performance problem after upgrade from 8.3 to 8.4
Следующее
От: Gerhard Wiesinger
Дата:
Сообщение: Re: Major performance problem after upgrade from 8.3 to 8.4