4

Is is an urban legend or having BLOB/CLOB columns last in a list of columns in a table really benefits performance and other aspects?

To "visualise". Is there any difference performance-wise (and other- wise) between these two table layouts:

A                            B
---------------------        ---------------------
ID      int                  ID      int
Name    nvarchar(200)        Content nvarchar(max)
Content nvarchar(max)        Name    nvarchar(200)
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288
  • http://stackoverflow.com/questions/34818/sql-server-does-column-order-matter – rahularyansharma Oct 17 '11 at 05:55
  • possible duplicate of [Performance / Space implications when ordering SQL Server columns?](http://stackoverflow.com/questions/6692021/performance-space-implications-when-ordering-sql-server-columns) – gbn Oct 17 '11 at 06:02

1 Answers1

2

Yes, it's an urban legend

On-disk layout is completely independent of the ordering of columns in the CREATE table. See this for more Performance / Space implications when ordering SQL Server columns?

Note: whether a varchar column is at the "start" or the "end", SQL Server still reads it the same via an offset from the NULL bitmap. The MAX column may be in the record or in another page if too long. SO still doesn't matter

There was an issue years ago (pre-dot net) with some SQL Server client drivers that preferred large text parameters at the end. Ancient myths.

Community
  • 1
  • 1
gbn
  • 422,506
  • 82
  • 585
  • 676
  • @Anton Gogolev: done for on-disk structures. It's in MSDN too. Can't find anything on the other bit because there is no online information for SQL Server 6.5 nowadays – gbn Oct 17 '11 at 05:59