Home » Performance » MySQL » Script to analyze all entries in a table and suggest optimal column data types.
Script to analyze all entries in a table and suggest optimal column data types. [message #1494] Wed, 27 June 2007 16:27 Go to previous message
RichardBronosky  is currently offline RichardBronosky
Messages: 20
Registered: June 2007
Junior Member
I've been working on a bash script that does this. I thought it was going to be really short and simple, but it is turning out to be quite complex. Before I continue with it, I want to know if such a thing already exists.

Basically I do a lot of queries to test each column like:
"select 'false.', \`$field\` from $TABLE where lpad(cast(0+\`$field\` as binary), length(\`$field\`), '0') != \`$field\` limit 1;"

Which tests to see if the data is an INT ZEROFILL.

Is there already a solution for this? If not, would anyone else be interested in helping to develop this? I intended to create a source forge project for it once I got a working version. But, I'm not finding the time to complete it.



.+# Richard Bronosky #+.
MySQL DBA, MythTV User

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Slow one-row INSERTs
Next Topic:HELP: mysqld Threads and Memory Usage Reporting
Goto Forum:

  


Current Time: Sun Jul 5 13:10:23 EDT 2009

Total time taken to generate the page: 0.00451 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.