Re: best db schema for time series data?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: best db schema for time series data?
Дата
Msg-id AANLkTinxevRJ0kg5wZ6opDeQm17x6-t_wtZA4PKZQork@mail.gmail.com
обсуждение исходный текст
Ответ на best db schema for time series data?  (Louis-David Mitterrand <vindex+lists-pgsql-performance@apartia.org>)
Ответы Re: best db schema for time series data?  (Louis-David Mitterrand <vindex+lists-pgsql-performance@apartia.org>)
Список pgsql-performance
Hello

my opinion:

@1 can be faster for access to last items with index
@2 can be more effective about data files length allocation

@1 or @2 - it depends on number of prices per product. For small
number (less 100) I am strong for @2 (if speed is important).
Personally prefer @2.

Pavel

2010/11/16 Louis-David Mitterrand <vindex+lists-pgsql-performance@apartia.org>:
> Hi,
>
> I have to collect lots of prices from web sites and keep track of their
> changes. What is the best option?
>
> 1) one 'price' row per price change:
>
>        create table price (
>                id_price primary key,
>                id_product integer references product,
>                price integer
>        );
>
> 2) a single 'price' row containing all the changes:
>
>        create table price (
>                id_price primary key,
>                id_product integer references product,
>                price integer[] -- prices are 'pushed' on this array as they change
>        );
>
> Which is bound to give the best performance, knowing I will often need
> to access the latest and next-to-latest prices?
>
> Thanks,
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

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

Предыдущее
От: Louis-David Mitterrand
Дата:
Сообщение: best db schema for time series data?
Следующее
От: Louis-David Mitterrand
Дата:
Сообщение: Re: best db schema for time series data?