开发者

Database cross table or one table is better

开发者 https://www.devze.com 2023-04-09 16:44 出处:网络
First, I have companies and their templates.templates in file table I related columns like this: FileTemplate

First, I have companies and their templates.templates in file table I related columns like this:

FileTemplate 
-------------------
ID -  CompanyID - Description  -  FileID

Second design:

FileTemplate            
-------------------
ID  -   Description   

CrossTable:

                        
-----------------------------------------      
ID  - CompanyID -  FileID  -  FileT开发者_开发问答emplateID          

Which design is better for performance and maintenance? There will be a lot of data (1 million rows). It will be a very active table.


As per my knowledge, the second approach is better as you have a huge amount of data. Normalizing is always the best approach. As you said, there should be company and field tables seperately along with the cross reference table.

Hope this is of some help for you!!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号