A Ticket has the statuses:
new in_progress on_hold closed
I could make
ticket.status a string (
on_hold) or an unique int(
2). It is indexed.
Int pros: smallest size in index
Int con: low clarity for BI and evolving schema (
3 compared to
String pro: clear data navigation
String con: takes more space to index, gives less performance for same RAM
I imagine a string index wont take too much space over an int index if its low cardinality. Is it premature optimization to choose integer if the field has low cardinality and is not part of a compound index?
I use Postgres with SQLAlchemy, Python ORM.