哪个更有效/更快:多个表还是一个大表? Sql server 2008 [英] Which is more efficient/fast : multiple tables or one large table? Sql server 2008

查看:159
本文介绍了哪个更有效/更快:多个表还是一个大表? Sql server 2008的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是使用SQL Server 2008数据库存储各种类型和其他字段的各种通知详细信息。



我将创建一个表并管理单个表中的所有数据并显示记录,现在使用case语句标题。但我有点担心大规模管理数据,复杂的显示数据调用或多人在同一时间在单个表中进行操作。



管理一张大桌子或不同桌子的记录是有意义的。



使用共享服务器管理网站和数据库,压缩量为1 GB。



调用,更新或搜索/操作时的速度考虑因素?



这是我的单表结构示例:



<前lang =C#> 通知:NotificationId,NotificationType,Title,Description,NotificationDate,UserId,IP,RepeatEveryDay,RepeatTill等。





这是一些例子多表结构:



  ReminderNotification :ReminderNotificationId,ReminderTitle,ReminderDescription,NotificationDate,RepeatEveryDay,RepeatTill, UserId,IP等。

SportsNotification :SportsNotificationId,SportsTitle,SportsDescription,NotificationDate,UserId,IP等。

NewsNotification : NewsNotificationId,NewsTitle,NewsDescription,NotificationDate,UserId,IP等。

FashionNotification :FashionNotificationId,FashionTitle,FashionDescription,NotificationDate,UserId,IP等。
< b> 5 更多表格像上一个。





我尝试过:



SQL查询执行时间与Single&多表。但两者都执行的时间几乎相同。

解决方案

如果列几乎与一个表相同。它将减少您从不同表加入的工作量,并且数据获取速度也会更好。另请参阅数据库规范化,因为它将向您展示如何规范化数据库。在数据库规范化 - 维基百科 [ ^ ]


My Application is to Store Various Notification details with type and some other fields Using SQL Server 2008 database.

I am going to make one table and mange all data in single table and display records and there titles using case statement for now. But i am little bit worried about managing data in large scale with complex call to display data or muliltiple people doing operation in single table at same time when it will be live.

Which will makes sense to manage records in one large table or Different tables.

Web Site and Database managing with shared server with ram amount of 1 GB.

Speed considerations in calling, updating or searching/manipulating?

Here's example of my Single table structure:

Notification : NotificationId, NotificationType, Title, Description, NotificationDate, UserId, IP, RepeatEveryDay, RepeatTill, etc.



Here's example of some of Multiple table structure:

 ReminderNotification : ReminderNotificationId, ReminderTitle,  ReminderDescription, NotificationDate, RepeatEveryDay, RepeatTill, UserId, IP, etc.

SportsNotification : SportsNotificationId, SportsTitle,  SportsDescription, NotificationDate, UserId, IP, etc.

NewsNotification : NewsNotificationId, NewsTitle, NewsDescription, NotificationDate, UserId, IP, etc.

FashionNotification : FashionNotificationId, FashionTitle, FashionDescription,  NotificationDate, UserId, IP, etc.
5 More tables Like Last one.



What I have tried:

SQL Query execution time comparing with Single & Mutliple table. But both executed in almost same amount of time.

解决方案

If columns are almost same than go for one table. It will less your effort to join from different tables and also data fetching speed would be better. please also look into Database Normalization as it will show you how to normalize the database. find more on Database normalization - Wikipedia[^]


这篇关于哪个更有效/更快:多个表还是一个大表? Sql server 2008的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆