I have a table with 4 columns:
postdate (date)
which (var of the char, length is 15)
res (enum, with 2 values)
impressions (int, length is 11)
I changed "postdate" from an int with a length of 8, thinking that a date type might be smaller and faster... I was wrong about the size, though! The table went from 6.4M to 8.1M when I changed it :'-( And the index went from 2.4M to 4.3M, so it almost doubled in size!
But anyway. I have one index on it, with postdate, which, and res set to be Unique. In my script, I insert a "1" to impressions, and if it's a duplicate then I increment impressions by 1.
What I don't understand, though, is that the data is 3.8M, and the index is 4.3M! Why? I only have the one index set up, so why is it 15% larger than the entire data?
And is int, length 8 generally faster / smaller than date?