graphing time series data

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема graphing time series data
Дата
Msg-id 20100414145434.GA13682@apartia.fr
обсуждение исходный текст
Ответы Re: graphing time series data  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-sql
Hi,

I have times series data in a 'price' table:

price(id_price, price, id_product, created, modified)

Prices are polled daily and a new 'price' row is created only if the
price of id_product changes, else modified is updated to now().

Now, I'd like to make a graph of average prices per week, per
id_product. As some prices don't vary much, distribution would not be
ideal if I simply 'group by extract(week from p.modified)'.

Ideally I'd generate_series() a list of weeks between min(p.created) and
max(p.modified) and then average prices 'group by p.modified < week'.

What would be the best way to tackle this?

Thanks,


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

Предыдущее
От: Mario Splivalo
Дата:
Сообщение: Using CASE in plpgsql causes 'ERROR: cache lookup failed'
Следующее
От: Richard Broersma
Дата:
Сообщение: Re: graphing time series data