Okay, since no one is interested in helping me with it… Is anyone interested in using it when it is done?
Here is the basic outline. For each column in the table, analyze the values:
[LIST=1]
[] Decide if the column is currently BINARY.
[] Get the length of the longest value.
[] If the values are numeric, then…[LIST=1]
[] Decide whether they require zerofill.
[] Decide if they are unsigned.
[] If they are all integers, decide what size is the best fit. Else…
[] If they are [fixed point] DECIMAL, decide their significant digits and number of decimal places. Else…
[] Decide if DOUBLE or single precision FLOAT is required.
[] (optionally) Decide the significant digits and number of decimal places that best fit.
[/LIST]
[] If the values are temporal[LIST=1]
[] Decide which is the best fit. (YEAR, DATE, TIME, TIMESTAMP, or DATETIME in that order of precedence)
[/LIST]
[] If an ENUM would be appropriate, suggest it.
[] If a CHAR would be most efficient, suggest it (BINARY is needed).
[] If the length you came up with first is < 255 (or 65535 post-MySQL 5.0.3) use VARCHAR (VARBINARY is needed). Else… Find the TEXT/BLOB size that best fits.
[/LIST]
What’s missing:
[LIST=1]
[] BIT type (I don’t use it)
[] SET type (I don’t want to code it) Spatial Types (I hope I never need it)
[/LIST]
I hope that draws some interest. I’ll take your continued silence to mean that I’m an idiot and the only person in the community who would like a tool for doing this. 