I've been browsing SQL dumps of some famous CMSes, including Drupal 7, Wordpress (some quite very old version), and some custom application based on Python.
All of these dumps contained data with string flags instead of integer ones. For example, a post's status was represented as published
, closed
, or inherit
rather than 1
, 2
, or 3
.
I have quite limited experience in design of databases and I have never went past simple SQLs, but I was always taught that I should use numeric/integer flags for data like this. It's obvious that tinyint
consumes much less space in a database than, for example, varchar(9)
.
So what am I missing? Isn't this a waste of data storage and a data redundancy? Wouldn't browsing, searching and indexing be a bit faster if these columns used integers instead of strings?
char
s? How inefficient!" is outdated compared to 2015.