MySQL Forums
Forum List  »  Partitioning

Can I add/change the number of hash subpartition?
Posted by: Osamu Shibata
Date: August 22, 2011 12:11PM

I have a table with partitions and subpartitions.
Structure is

CREATE TABLE `test` (
`col1` tinyint(2) unsigned NOT NULL DEFAULT '0',
`col2` date NOT NULL,
PRIMARY KEY (`col1`,`col2`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
/*!50100 PARTITION BY RANGE (to_days(col2))
SUBPARTITION BY HASH (col1)
SUBPARTITIONS 10
(PARTITION p2008 VALUES LESS THAN (733773) ENGINE = MyISAM,
PARTITION p2009 VALUES LESS THAN (734138) ENGINE = MyISAM,
PARTITION p2010 VALUES LESS THAN (734503) ENGINE = MyISAM,
PARTITION p2011 VALUES LESS THAN (734868) ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;

It works well.
After that, I want to add subpartition. The number of subpartitions from 10 to 12.

For partitions,
"ALTER TABLE test ADD PARTITION PARTITIONS 2;"
this is the correct query but what about subpartitions?

I tried some like
"add subpartitions...."
"reorganize partitions .... subpartitions 12"
All didn't work.

Maybe remove partitioning and add partition again to unpartitioned data?

Options: ReplyQuote


Subject
Views
Written By
Posted
Can I add/change the number of hash subpartition?
4285
August 22, 2011 12:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.