What is the best design for a table, a Type
field that is of int
or char(1)
? In other words, given this schema:
create table Car
(
Name varchar(100) not null,
Description varchar(100) not null,
VehType .... not null
)
Is it more efficient (performance wise) for VehType
to be an int
or a char(1)
? Say you have five types of cars, should you use the incrementing values 0 -> 4, or characters for the types (say; 'v', 's', 'c', 't', 'm')?
If it is any more than that, I'd use a separate Type table and have a foreign key relationship, but I don't see the need for that.
I notice that the sys.objects
catalog view uses a character for the type
field. Is there a reason for that? Am I just grabbing at thin air here, and is it whatever I'm more comfortable with?