I've an ever-growing table(~20 Million rows in a year).
The table has a status
column which is enum
type with 10 states like:
ENQUEUED, DELIVERED, FAILED, ...
Since Postgres enum
type takes 4 bytes space, I decided to alter the column to something less needed space like smallint
or character(1)
or "char"
.
enum takes 4 bytes
smallint takes 2 bytes
character(1) takes 2 bytes
"char" takes 1 byte
I want to use "char"
with this values:
E, D, F, ...
Because "char"
takes less space than smallint
or character(1)
Is it good idea to use "char"
as a less space replacement for enum
?
Any ideas would be great appreciated.