Here's a little bit of an academic question:
Let's assume I have an indexed 32-bit integer column. I want to change this column to be a CHAR(7) containing an alpha numeric encoding of the original integer value. Other than the obvious nearly 100% increase in index size, are there any other, less obvious draw backs to using a CHAR column over an INT? I'm only interested in using the index for lookups, so I will never perform a range scan on the index.
Please remember this is an academic question. I'm not looking for responses like "why would you do that, its stupid, just use an INT and do your conversion in application code". I'm looking for something more like "use CHAR(8) to have proper byte alignment" or "when using a GROUP BY on a CHAR column, the MySQL 5.0 query optimizer will ignore your index every other Friday due to some fictitious bug".
Let's assume I have an indexed 32-bit integer column. I want to change this column to be a CHAR(7) containing an alpha numeric encoding of the original integer value. Other than the obvious nearly 100% increase in index size, are there any other, less obvious draw backs to using a CHAR column over an INT? I'm only interested in using the index for lookups, so I will never perform a range scan on the index.
Please remember this is an academic question. I'm not looking for responses like "why would you do that, its stupid, just use an INT and do your conversion in application code". I'm looking for something more like "use CHAR(8) to have proper byte alignment" or "when using a GROUP BY on a CHAR column, the MySQL 5.0 query optimizer will ignore your index every other Friday due to some fictitious bug".
Comment