这张桌子应该分成两部分吗?
我有一个有 11 列的表,现在大多数情况下该表上的三列都是空的,但如果我分成两列,每个表会有更多查询。你的建议是什么
I have a table which has 11 columns, now most of the time three columns on this table will be empty, but then if I split in two, there are more queries per table. Whats your suggestions
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
还有许多其他变量需要考虑。我想到的是:
但总的来说,我认为将其保留为单个表是可以的。 11 列并不算多。因此,除非表非常大(相对而言)并且空间非常宝贵,否则单个表的简单性是一个好主意,特别是当数据逻辑上属于表时。
There are a number of other variables to take into account. Some that come to mind are:
In general, though, I would say that leaving it as a single table is okay. 11 columns are not that many. So unless the table is really large (a relative term) and space is at a premium, the simplicity of a single table is a good idea particularly if the data logically belongs in the table.
如果您主要关心的是速度,那么将表放在一起将为您提供更便宜的 SELECT 查询,因为您不需要 JOIN。
If your primary concern is speed, then keeping the table together would grant you less expensive SELECT queries since you won't meed to JOIN.
就我个人而言,我认为对于 11 列,无论哪种方式,您的性能提升都将是最小的。我认为目前这更多是个人喜好。
Personally, I think with 11 columns, your performance gains will be minimal either way. I think it's more personal preference at this point.