Now I have a table with impressions, clicks and ctr.
I was wondering if I should use tinyint(1) and store ctr which has a range from 1-250
or should I store it as a float which has more precision. or maybe decimal.
For statistics I would be calculating the ctr using clicks/impressions, so getting a precise value is not a problem.
But for performance what would be the best way to store it.
If you’re using php to calculate the CTR based on your mysql data, then there’s no reason to use float or decimal – just use tinyint.
But if you want to have the CTR stored in the database, then use float – it’s like a small version of decimal.