Is there any performance difference between varchar(1)
and char(1)
? Which RDBMS handle these two datatypes and sizes in different ways?
In MS SQL VARCHAR(1)
uses three bytes of storage and CHAR(1)
uses one byte of storage.
CHAR(1)
is more efficient than VARCHAR(1)
in processing and storage.
The breakeven point on VARCHAR
would be anything greater than 3 characters if using variable length data.
If using fixed length then CHAR
is always more efficient by two bytes.
REF: http://msdn.microsoft.com/en-gb/library/ms176089.aspx
The difference will be negligible in most cases. Concentrate your performance oriented design efforts in places where it will make a real difference, like table composition and index design.
It helps to divide the design effort into two layers: logical design and physical design.
Most of the performance oriented effort is in the second stage, physical design.
In logical design, flexibility trumps performance. Except when it doesn't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With