Varchar(8000) and Memory Allocation

  • I have a general question. I have noticed that my current client has all their varchar columns in all of their 1100 tables set to varchar(8000). I realize that varchar is varialbe in length and will use only what is needed but does this effect how memory is allocated? Also, does it effect page reads, selects from the table or anything at all? I am just looking for an overall opinion on pros/cons on what they are doing? Thanks!

  • Even the column is set to varchar(8000), it will not take up 8000 bytes, it depends on the actual size of the data.

  • That looks like laziness on their part. They obviously didn't want to take the time to analyze the data that would be stored in the varchar fields so that they could be sized appropriately, even if still defined as varchar fields.

    😎

  • Yes, agreed, definite laziness but initially when tables with lets say 20 varchar fields are created the initial page size is huge. However, just my opinion is not getting through to them and I've searched everywhere for any kind of documentation that would advise against this. Anyone know anything out there besides this forum thread 🙂

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

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