MySQL Forums
Forum List  »  Partitioning

Re: ALTER TABLE t_test ADD PARTITION BY LIST(field)?
Posted by: Mattias Jonsson
Date: September 19, 2011 09:10AM

Hi Carlo,

first you cannot do ADD PARTITION to a non partitioned table (syntax ADD PARTITION BY LIST is wrong).

If you already have a table you can alter the table to make use of partitioning by:
ALTER TABLE t_test PARTITION BY LIST(marca_id)
(PARTITION m001 VALUES IN (1,2,3),
PARTITION m002 VALUES IN (4),
PARTITION m003 VALUES IN (5,6),
PARTITION m004 VALUES IN (7,8,9),
PARTITION m005 VALUES IN (10,11,12));

And then you can add partitions by:
ALTER TABLE t_test ADD PARTITION
(PARTITION m006 VALUES IN (13));

Read more at:
http://dev.mysql.com/doc/refman/5.5/en/partitioning-management-range-list.html
http://dev.mysql.com/doc/refman/5.5/en/partitioning-list.html
http://dev.mysql.com/doc/refman/5.5/en/alter-table.html

Regards
Mattias Jonsson

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: ALTER TABLE t_test ADD PARTITION BY LIST(field)?
15205
September 19, 2011 09:10AM


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.