Hi,
I have a daily feed to update my database table with.
The feed contains this data:
Product_code,
Todays timestamp
Description (300 chars)
Daily Sales
Product Price
Product Cost
There are over 20,000 products in the update file every day.
95% of the products are already in the database from previous days but about 5% are new ones.
The Description does NOT usually change, but it can do and I have to record it, keeping the old description and the date of change.
So far, I have just been adding a row for each daily update, but this is wasting a lot of disk space because generally only two fields change (the timestamp and daily sales figure).
I am trying to work out a better way of doing it.
One thought is to check if there is any change to the Description, price etc and if there is not, just put a null in the field for that day. I assume that would save disk space ?
Maybe a better way is to have two tables that are joined.
Like this:
Product_code,
Todays timestamp
Description (300 chars)
Product Price
Product Cost
and:
Product_code,
Todays timestamp
Daily Sales
It is going to make the searches that I do on the databases more complicated, but maybe this is better?
Any help would be appreciated
I have a daily feed to update my database table with.
The feed contains this data:
Product_code,
Todays timestamp
Description (300 chars)
Daily Sales
Product Price
Product Cost
There are over 20,000 products in the update file every day.
95% of the products are already in the database from previous days but about 5% are new ones.
The Description does NOT usually change, but it can do and I have to record it, keeping the old description and the date of change.
So far, I have just been adding a row for each daily update, but this is wasting a lot of disk space because generally only two fields change (the timestamp and daily sales figure).
I am trying to work out a better way of doing it.
One thought is to check if there is any change to the Description, price etc and if there is not, just put a null in the field for that day. I assume that would save disk space ?
Maybe a better way is to have two tables that are joined.
Like this:
Product_code,
Todays timestamp
Description (300 chars)
Product Price
Product Cost
and:
Product_code,
Todays timestamp
Daily Sales
It is going to make the searches that I do on the databases more complicated, but maybe this is better?
Any help would be appreciated
Comment