| От | Louis-David Mitterrand |
|---|---|
| Тема | best db schema for time series data? |
| Дата | |
| Msg-id | 20101116105055.GA26129@apartia.fr обсуждение |
| Ответы |
Re: best db schema for time series data?
Re: best db schema for time series data? |
| Список | pgsql-performance |
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,
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера