I think you are concerned about performance, given the large number of records that you can generate - 140 companies * 4 data points / hour * 8.5 hours * 250 trading days / year means that you view about 1.2 million data points in year.
Modern relational database systems can easily handle this number of records - taking into account some important considerations - in one table - I do not see a problem with storing 100-year-old data points.
So yes, your initial design is probably the best:
Company Name | Price | Date | Etc ... |
Create indexes for company name and date; that will allow you to answer questions such as:
- What was the highest company stock price x
- what was the stock price of company x at date y
- on date y, which was the highest share price
To prevent performance issues, I would create a test database and populate it with sample data (tools like dbMonster make it easy), and then build queries that you (you think) will work against a real system; Use your database configuration tools to optimize these queries and / or indexes.
source share