Sql Server 性能和字段顺序 [英] Sql Server Performance And Order Of Fields

查看:32
本文介绍了Sql Server 性能和字段顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表中字段的创建顺序是否会影响表上命令的性能?如果答案是肯定的,有人可以讨论吗?

例如我创建了一个这样的表

For example i have create a table like this

create table Software(int id,alpha datetime,beta datetime,title nvarchar(100),stable datetime,description nvarchar(200) )

如果我改成

create table Software(int id,alpha datetime,beta datetime,stable datetime,description nvarchar(200),title nvarchar(100) )

有什么性能影响吗?

清楚了吗?

推荐答案

字段 order 没有任何区别(当然,如果字段总是相同的)

The field order makes no difference whatsoever (if the fields are always the same of course)

无论如何,磁盘结构将几乎保持不变.简单地说:

The on-disk structure will remain the same pretty much regardless. Simply:

  • 标题
  • 固定长度列
  • 空位图
  • 可变长度列

您在上面所做的只是重新排列固定长度"和可变长度"部分内的一些列.但是,无论它们的顺序如何,都需要相同的处理来检索它们.

All you're doing above is rearranging some columns inside the "fixed length" and "variable length" sections. However, the same processing is required to retrieve them no matter which order they are in.

参见 Paul兰德尔的文章

这篇关于Sql Server 性能和字段顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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