I have a table with about 32 million rows, and growing daily.
One column in this field is a UNIQUE column for the date. I'm not storing time, just the day itself. It's used to count the number of impressions for each ID per day, so if the day already exists then it increments another column.
I've been using INT(8) for this column, storing dates like:
20190516
I tried changing it to DATE in the theory of saving storage space and making the index faster, but the storage size was MUCH larger. I'm of the understanding that an INT(8) takes 4 bytes while a DATE takes 3, but the index size went from 561.9M to 771.1M!
I'm running a smidge low on storage on my server, and I'm trying to push off upgrading as long as possible, so storage size does matter. But if it's faster to process for some reason, then I can justify 200M.
Or is there a better type to store the date than these?