Bug #23227 PROCEDURE ANALYSE needs better documentation
Submitted: 12 Oct 2006 19:21 Modified: 26 Oct 2006 18:51
Reporter: Baron Schwartz (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:All OS:Any (All)
Assigned to: Paul DuBois CPU Architecture:Any

[12 Oct 2006 19:21] Baron Schwartz
Description:
The manual page for PROCEDURE ANALYSE

http://dev.mysql.com/doc/refman/5.1/en/procedure-analyse.html

Says very little about this important feature.  It would be good to have an overview of what it does.  I realize this is 'just a sample' but it is very useful in real life, and is more than just a sample to many people.

This is not a duplicate of bug 3903.

How to repeat:
Documentation bug.

Suggested fix:
Remove the first and last paragraph.  Insert the following before the first paragraph:

PROCEDURE ANALYSE examines the results of a query to try to determine the optimal data type for each column.  Use it by appending the following to any normal SELECT query:

  PROCEDURE ANALYSE([max_elements,[max_memory]])

For example,

  SELECT col1, col2 from table1 PROCEDURE ANALYSE(3, 10)

The results will show some statistics over the values returned by the query, and propose an optimal data type for the columns.  This can be helpful for checking your existing tables, or when importing new data.  You may need to try different settings for the optional arguments so PROCEDURE ANALYSE() does not suggest ENUM types when it is not appropriate.
[12 Oct 2006 19:45] Sveta Smirnova
Thank you for the reasonable feature request.
[26 Oct 2006 18:51] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

I incorporated some of the suggested text into the existing description,
though not exactly in the suggested form.