varchar Fields - Is a Power of Two More Efficient?

前端 未结 5 1478
旧时难觅i
旧时难觅i 2020-12-08 09:02

Is it more efficient to use a varchar field sized as a power of two vs. another number? I\'m thinking no, because for SQL Server the default is 50.

Howe

5条回答
  •  情话喂你
    2020-12-08 09:38

    The only tangible benefit you will see from using certain maximum lengths is the storage space required for the VARCHAR. A maximum length over 255 would require an extra byte to store the length of the value in each row (and an extra 2 bytes for lengths of 256^2 or greater and so on).

提交回复
热议问题