Column length and Performance

  • Should there a peformance hit associated with making columns larger than they need to be?  And if so, why and under what conditions?  What about index efficiency?

    I am looking at an application that has compact PKs and FKs, but has several fields that are nvarchar(4000). No current indexes on these fields; app is highly write intensive and is having performance problems at times.  I created a test database with current  table strucutre and another test database with tables sized appropriately.  I then ran sql code associated with application on both databases and didnot notice any discernable difference in CPU utilization or I/O, which kinda of suprised me.

    Any insights appreciated.

     

  • Theoretically, the smaller key fields the better. SQL Server manages data in page, which is around 8k size, the smaller the key fields, the more fit in a page, the less I/O.

  • Other than creating large dynamic statements, why would you need a Nvarchar(4000)?

    SQL supports (image & text) types which are much more effient in storage&recall..

     


    Regards,

    Coach James

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply