Author |
Topic |
oguzkaygun
Yak Posting Veteran
53 Posts |
Posted - 2009-12-01 : 15:05:10
|
Helloi use MSSQL2005 and MSSQL2008. if i work with a lot of records (for example 1.000.000 or 2.000.000 or more), what i should i do ?Firstly Should i use one table for each company ?Second Should i use "create view" and i use only one table for a lot of company ?Note: My design is for financel software. Thanks |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
oguzkaygun
Yak Posting Veteran
53 Posts |
Posted - 2009-12-02 : 01:49:13
|
HelloThanks for your reply.Partions means that "Create View"?Thanks |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2009-12-02 : 01:50:24
|
Focus on design , at this point , i.e relational principles and optimising the SELECT statements. As well as indexes mentioned , ensure there is sufficient ( and appropraite) maintenance on the indices - by this I mean : statistics , fragmentation levelsJack Vamvas--------------------http://www.ITjobfeed.com (IT jobs) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2009-12-02 : 01:53:21
|
quote: Originally posted by oguzkaygun HelloThanks for your reply.Partions means that "Create View"?Thanks
No I am referring to partitioned tables which is a technology available in SQL Server 2005 and 2008. You should look into partitioning once your table gets to the 500 million range. Whatever you do, do not create a table for each company. SQL Server can handle the load in just one table. You just need to design your indexes and queries properly. I don't think I'd use views for what you've described. I'd just use a stored procedure that has an input parameter for the company and then use that input parameter in your WHERE clause.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog"Let's begin with the premise that everything you've done up until this point is wrong." |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2009-12-02 : 01:53:21
|
The decision for the VIEW is dependant on how you want to manage the retrieval of the the data , for example , you may have a complex structure , which may require some streamlining , or may want to release access to the data , but not allow developers th view the underlying select statementsJack Vamvas--------------------http://www.ITjobfeed.com (IT jobs) |
|
|
oguzkaygun
Yak Posting Veteran
53 Posts |
Posted - 2009-12-03 : 04:54:40
|
Helloi have two question.Firstly. If i create new coulums and new sql query (select, insert, update or delete) after i have done partition, Should i do partition again. Or my partition will see my new coulums and my new sql query. Also i can create new table too.Second. When i done tree partition (company id =1 one partition,company id=2 second partition, company id=3 third partition), can i see all records more fast with select query ? Or can i see only partition1 or partition2 or partition3 more fast with select query? Should i use Select * from Table1 or should i use Select * from table where companyid='1' ?Thanks |
|
|
|