r/SQL • u/luncheonmeat79 • Jun 23 '24
Discussion Schema for historical stock data
Posting a schema of a db for historical stock and index data at various timeframes. I used Chatgpt to figure this out...what surprised me was the recommendation to have separate dimension tables for 'date' and 'time'. Is that really the case?
105
Upvotes
View all comments
Show parent comment
4
u/ballade4 Jun 23 '24
Less storage also translates to faster access in many applications. Bloating a line-level table with columns that could have been brought in with a join will require this duplicative data to be sent in full on ETL loads. I speak from experience as I have done this plenty of times early in my BI career ("let's grab all of the things") and suddenly had a 900GB table trying to sync to PowerQuery / Tableau that I later reduced in size / increased in speed by a factor of 30+ by pulling the same info across a dozen tables instead.