MySQL Forums
Forum List  »  Partitioning

Re: reorganize syntax / procedure
Posted by: Mattias Jonsson
Date: January 13, 2012 10:35AM

I don't think you can do step 1, since you would give you the following error:
query 'ALTER TABLE ap_log REORGANIZE PARTITION p12 INTO (
PARTITION p12t VALUES LESS THAN (1333252800) ENGINE = InnoDB)' failed: 1520: Reo
rganize of range partitions cannot change total ranges except for last partition
where it can extend the range

I would suggest you to do combine 1) and 2) into:
ALTER TABLE ap_log REORGANIZE PARTITION p12 INTO
(PARTITION p12 VALUES LESS THAN (1333252800) ENGINE = InnoDB,
PARTITION p13 VALUES LESS THAN (1341115200) ENGINE = InnoDB,
PARTITION p14 VALUES LESS THAN (1349064000) ENGINE = InnoDB,
PARTITION p15 VALUES LESS THAN (1357016400) ENGINE = InnoDB,
PARTITION p16 VALUES LESS THAN (1364788800) ENGINE = InnoDB,
PARTITION p17 VALUES LESS THAN (1372651200) ENGINE = InnoDB,
PARTITION p18 VALUES LESS THAN (1380600000) ENGINE = InnoDB,
PARTITION p19 VALUES LESS THAN (1388552400) ENGINE = InnoDB,
PARTITION p20 VALUES LESS THAN MAXVALUE ENGINE = InnoDB);

Which works

> I do have a question on the syntax and how the
> SUBPARTITIONS will be handled.
> When I reorg p12 will the subpartitions remain
> intact?

All partitions will have 12 subpartitions also after reorg.

> When I add the newer tables will the subpartition
> definition of the table follow through or do I
> need to explicitly state that again in my ADD
> statement.

Do you mean newer partitions? The subpartition definition will exist until you changes the partitioning with ALTER TABLE ap_log PARTITION BY ... SUBPARTITION BY ...

Regards
Mattias

Options: ReplyQuote


Subject
Views
Written By
Posted
4362
January 12, 2012 03:36PM
Re: reorganize syntax / procedure
5092
January 13, 2012 10:35AM
1910
January 13, 2012 03:57PM
2448
January 13, 2012 07:34PM


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.