Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Designing SQL tables for a large DB

Author  Topic 

omritt
Starting Member

3 Posts

Posted - 2011-01-26 : 08:10:42
Hi,
I'm pretty new to SQL and I have the following design issue:

I want to keep a database (MS SQL 2008 R2) which will hold about 5 billion rows.
The database keeps historical data for each month and year. It needs to hold about 30-40 million rows for each month and needs to save data for many years (~10).
I will be needing to do a lot of data pulling from the database as well.
Can anyone recommend a good structure I can save my data in?

Thanks a lot.

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2011-01-26 : 08:33:06
The information is only partial.. however, given that.. you could create a new database for each quarter and use views to join data from the different databases.. and each database having same schema..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

omritt
Starting Member

3 Posts

Posted - 2011-01-26 : 09:53:27
Thanks for your reply, Dinakar.
I've though about it, but when tested it, it took a very long time to query the large tables.
Could it be because lack of indexing?

quote:
Originally posted by dinakar

The information is only partial.. however, given that.. you could create a new database for each quarter and use views to join data from the different databases.. and each database having same schema..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-01-26 : 10:09:40
Table Partitioning
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-01-26 : 11:12:01
i also think Table Partitioning would be good option. Partition data based on date field.

see below link for more details

http://blog.sqlauthority.com/2008/01/25/sql-server-2005-database-table-partitioning-tutorial-how-to-horizontal-partition-database-table/

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

omritt
Starting Member

3 Posts

Posted - 2011-01-26 : 12:50:08
Thank you very much guys. I will read about table partitioning and try to implement it at my project.
Thanks a lot for the help!
Go to Top of Page
   

- Advertisement -