Bug #46972 | Procedure analyse does not work as doucmented with (var)char columns | ||
---|---|---|---|
Submitted: | 28 Aug 2009 11:56 | Modified: | 23 Oct 2009 13:21 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: General | Severity: | S2 (Serious) |
Version: | 5.0, 5.1 - probably any | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[28 Aug 2009 11:56]
Peter Laursen
[28 Aug 2009 12:06]
Peter Laursen
However I find when using 2nd parameter SELECT * FROM t2 PROCEDURE ANALYSE(1,10); -- ENUMs not proposed SELECT * FROM t2 PROCEDURE ANALYSE(1,10000); -- ENUMS proposed The 2nd parameter is described like this ".. is the maximum amount of memory that ANALYSE() should allocate per column while trying to find all distinct values." This does not explain the different behaviour of the two statements above.
[28 Aug 2009 12:09]
Peter Laursen
Sorry for one copy/paste mistake in the create statement! First coloumn of the table is not named `utf8_general_ci` but `ID`
[28 Aug 2009 14:57]
Valeriy Kravchuk
Thank you for the bug report. Verified just as described with recent 5.1.39 from bzr on Mac OS X. Workaround is to try different values for parameters of PROCEDURE ANALYZE(), as suggested in the manual: "You may need to try different settings for the arguments so that PROCEDURE ANALYSE() does not suggest the ENUM data type when it is not appropriate."
[28 Aug 2009 15:16]
Peter Laursen
The two statements: 1: "if there are more than max_elements distinct values, then ENUM is not a suggested type." 2: "You may need to try different settings for the arguments so that PROCEDURE ANALYSE() does not suggest the ENUM data type when it is not appropriate." .. are simply in conflict! If 1) is true then 2) is not necessary. It really looks like this was reproted before (internally or not) and somebody thought that just adding such stupid note (2) to documentation solves anything. This is completely crazy!
[23 Oct 2009 12:03]
Peter Laursen
A colleague pointed my attention to: http://bugs.mysql.com/bug.php?id=44060 .. duplicates?
[23 Oct 2009 13:21]
Valeriy Kravchuk
Duplicate of Bug #44060 it seems.