Do you know which table srtucture is better :
table user
id INT pk autoincrement
name VARCHAR(255)
email VARCHAR(255)
statut TINYINT(4)
The statut can only hold 2 states : 1/2
OR
table user
id INT pk autoincrement
name VARCHAR(255)
email VARCHAR(255)
statut VARCHAR(45)
The statut can only hold 2 states : active/inactive
I'm looking for the fastest way to do select statements such as
SELECT id, name, email
FROM user
WHERE statut=:statut
I read somewhere that "integer" types are generally processed faster
than "text" types
but for some other reasons I would prefer to store the statut
with the VARCHAR
type.
Is there a way to use statut with VARCHAR
type AND that it runs faster ?
Or is the first structure definitively the fastest ?