I was asked by the developer to create a table and one of the columns on this table they are asking to be a varchar(25). For some unknow reason to me I decided to dig dipper into it.
Some information states that is the column is defined as varchar and if there are regular updates and new data for the column is bigger then the original, the record will be moved to another page in the table.And then it will cause significant performance issue since multiple pages are required to return a single row.
Other
- If the size of actual data varies significantly, VARCHAR is more efficient because CHAR adds extra blank characters to fill the field. These blank characters must be transmitted across the network like any other characters.
- If the size of actual data does not vary much, CHAR is more efficient because each VARCHAR field has a few bytes of length information which must be transmitted.
It seams to me that since they are requesting only 25 bytes, and if they are going to be doing regular updates it would be beneficial to define this column as a char even so it will hold extra blank characters, but it wont have many single record pages.
Anyone willing to offer a different take on it? Thank you.