Bug #75094 Partition pruning limitations not documented
Submitted: 3 Dec 2014 15:11 Modified: 4 Dec 2014 18:13
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6.22 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: enum, Geometry, partitioning, pruning, spatial

[3 Dec 2014 15:11] Daniël van Eeden
Description:
ENUM an GEOMETRY are not used for partition pruning. This is disallowed in fields_ok_for_partition_index() in sql/opt_range.cc

I can't find this in the docs:
http://dev.mysql.com/doc/refman/5.6/en/partitioning-limitations.html
http://dev.mysql.com/doc/refman/5.6/en/partitioning-pruning.html

Only this is in the docs, but that's for partition creation, not for pruning:
"Spatial columns.  Columns with spatial data types such as POINT or GEOMETRY cannot be used in partitioned tables."

Related: Bug #75085

How to repeat:
Compare code and behaviour of mysqld with docs for partion pruning for enum and spatial types.
[3 Dec 2014 17:43] MySQL Verification Team
Quite true. Hence, verified.
[4 Dec 2014 17:43] Jon Stephens
NB: Since a partitioned table may not have any columns that use spatial types, there's no need to state that spatial columns aren't used for pruning.
[4 Dec 2014 18:11] Jon Stephens
The Manual already clearly states at http://dev.mysql.com/doc/refman/5.6/en/partitioning-pruning.html:

      When a table is partitioned by HASH or KEY, pruning can be used 
      only on integer columns.

I think it's made clear in our documentation that when we say "integer[ type]s", we are referring to any of TINYINT, SMALLINT, INT, MEDIUMINT, BIGINT. There is no basis to assume ENUM is among these, and I don't think you'll find anything in the Manual suggesting that it should be. So this is really a non-issue. However, I'm amending the above statement to read "When a table is partitioned by HASH or [LINEAR] KEY, pruning can be used only on integer columns" just to remove any doubt.
[4 Dec 2014 18:13] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.

mysqldoc rev 40927 - ENUM can be used for a partitioning key if the table is partitioned by KEY or LINEAR KEY

Closed.
[4 Dec 2014 18:58] Jon Stephens
The following bugs are related to this one: 

BUG#75085

BUG#60288

BUG#39548