I have a table that's partitioned by range on id, and by hash on code (both are integers). 30 partitions, 4 hashed subpartitions apiece, 120 total.
If I do a select on id alone, explain plan shows that it's correctly pruning down to only the partition & subpartitions related to it (4)
If I do a select on id + code, explain plan shows that it's correctly pruning down to the one specific subpartition related to it (1)
HOWEVER...
If I do a select on code alone, explain plan seems to be showing that MySQL is doing a full table scan (120 partitions), instead of acting like Oracle and scanning only the one subpartition of each partition that would be relevant (30 total).
Do I have to do something special to get MySQL to take advantage of subpartition-pruning when it can't prune away entire partitions? Or does MySQL (5.1, at least) just not support taking advantage of subpartitions by themselves?