Re: [PERFORM] best db schema for time series data?

2010-11-19 Thread Louis-David Mitterrand
On Tue, Nov 16, 2010 at 11:35:24AM -0500, Chris Browne wrote: vindex+lists-pgsql-performa...@apartia.org (Louis-David Mitterrand) writes: 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:

Re: [PERFORM] best db schema for time series data?

2010-11-19 Thread Louis-David Mitterrand
On Tue, Nov 16, 2010 at 05:28:19PM +0100, Harald Fuchs wrote: In article 4ce2688b.2050...@tweakers.net, Arjen van der Meijden acmmail...@tweakers.net writes: On 16-11-2010 11:50, Louis-David Mitterrand wrote: I have to collect lots of prices from web sites and keep track of their

Re: [PERFORM] best db schema for time series data?

2010-11-19 Thread Chris Browne
vindex+lists-pgsql-performa...@apartia.org (Louis-David Mitterrand) writes: On Tue, Nov 16, 2010 at 11:35:24AM -0500, Chris Browne wrote: vindex+lists-pgsql-performa...@apartia.org (Louis-David Mitterrand) writes: I have to collect lots of prices from web sites and keep track of their

Re: [PERFORM] best db schema for time series data?

2010-11-19 Thread Robert Klemme
On Fri, Nov 19, 2010 at 10:50 AM, Louis-David Mitterrand vindex+lists-pgsql-performa...@apartia.org wrote: On Tue, Nov 16, 2010 at 05:28:19PM +0100, Harald Fuchs wrote: In article 4ce2688b.2050...@tweakers.net, Arjen van der Meijden acmmail...@tweakers.net writes: On 16-11-2010 11:50,

[PERFORM] best db schema for time series data?

2010-11-16 Thread Louis-David Mitterrand
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

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Pavel Stehule
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

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Louis-David Mitterrand
On Tue, Nov 16, 2010 at 12:03:29PM +0100, Pavel Stehule wrote: Hello my opinion: @1 can be faster for access to last items with index @2 can be more effective about data files length allocation Hi Pavel, What is data files length allocation ? -- Sent via pgsql-performance mailing list

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Pavel Stehule
2010/11/16 Louis-David Mitterrand vindex+lists-pgsql-performa...@apartia.org: On Tue, Nov 16, 2010 at 12:03:29PM +0100, Pavel Stehule wrote: Hello my opinion: @1 can be faster for access to last items with index @2 can be more effective about data files length allocation Hi Pavel, What

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Arjen van der Meijden
On 16-11-2010 11:50, Louis-David Mitterrand wrote: 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

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Louis-David Mitterrand
On Tue, Nov 16, 2010 at 12:18:35PM +0100, Arjen van der Meijden wrote: On 16-11-2010 11:50, Louis-David Mitterrand wrote: 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

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Jayadevan M
Hi, If you mostly need the last few prices, I'd definitaly go with the first aproach, its much cleaner. Besides, you can store a date/time per price, so you know when it changed. We too were using such an approach for 'soft deletes'. Soon we realized that using a one char valid flag to

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Harald Fuchs
In article 4ce2688b.2050...@tweakers.net, Arjen van der Meijden acmmail...@tweakers.net writes: On 16-11-2010 11:50, Louis-David Mitterrand wrote: 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:

Re: [PERFORM] best db schema for time series data?

2010-11-16 Thread Chris Browne
vindex+lists-pgsql-performa...@apartia.org (Louis-David Mitterrand) writes: 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,