MySQL hint/trick: procedure analyse

Posted: 2011/08/29 in Development, MySQL

My good friend Ian (isnoop.net), a great guy and amazing developer, pointed out this MySQL function: PROCEDURE ANALYSE. To quote the website (2nd paragraph):

ANALYSE() examines the result from a query and returns an analysis of the results that suggests optimal data types for each column that may help reduce table sizes. To obtain this analysis, append PROCEDURE ANALYSE to the end of a SELECT statement.

Simple, helpful analysis. It doesn’t ‘fix’ things but is a nice, additional tool to EXPLAIN. What’s most unique, though, is that this function is buried in the “Extending MySQL :: Adding New Procedures to MySQL” section.  I would never go to these pages in MySQL.com as I can’t think of anything I need MySQL to do that it doesn’t do already… I’m no DBA to be sure!

But I DO have a pretty bizarre SELECT I need to write today. I’m looking forward to seeing how EXPLAIN and PROCEDURE ANALYSE might help me in not burying our MySQL server!

.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s