Which method should used to add a new g201305 partition to the table?

Consider the following table: CREATE TABLE ‘game’ ( ‘id’ int (10) unsigned NOT NULL
AUTO_INCREMENT, ‘keyword’ varchar (45) DEFAULT NULL, ‘date’ datetime NOT NULL,
PRIMARY KEY (‘id’ , ‘date’), UNIQUE KEY ‘keyword_idx’ (‘keyword’ , ‘date’) )
ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (TO_DAYS (date) )
( PARTITION g201301 VALUES LESS THAN (TO_DAYS (‘2013-01-01 00:00:00’) ),
PARTITION g201302 VALUES LESS THAN (TO_DAYS (‘2013-02-01 00:00:00’) ),
PARTITION g201303 VALUES LESS THAN (TO_DAYS (‘2013-03-01 00:00:00’) ),
PARTITION g201304 VALUES LESS THAN (TO_DAYS (‘2013-04-01 00:00:00’) ),
PARTITION gMORES VALUES LESS THAN (MAXVALUE) ); Which method should used to
add a new g201305 partition to the table?

Consider the following table: CREATE TABLE ‘game’ ( ‘id’ int (10) unsigned NOT NULL
AUTO_INCREMENT, ‘keyword’ varchar (45) DEFAULT NULL, ‘date’ datetime NOT NULL,
PRIMARY KEY (‘id’ , ‘date’), UNIQUE KEY ‘keyword_idx’ (‘keyword’ , ‘date’) )
ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (TO_DAYS (date) )
( PARTITION g201301 VALUES LESS THAN (TO_DAYS (‘2013-01-01 00:00:00’) ),
PARTITION g201302 VALUES LESS THAN (TO_DAYS (‘2013-02-01 00:00:00’) ),
PARTITION g201303 VALUES LESS THAN (TO_DAYS (‘2013-03-01 00:00:00’) ),
PARTITION g201304 VALUES LESS THAN (TO_DAYS (‘2013-04-01 00:00:00’) ),
PARTITION gMORES VALUES LESS THAN (MAXVALUE) ); Which method should used to
add a new g201305 partition to the table?

A.
ALTER TABLE games ADD PARTITION g201350 VALUES LESS THAN (TO_DAYS
(‘2013-05-01 00:00:00’) );

B.
ALTER TABLE games COALESCE PARTITION (gMORES) INTO g01305 VALUES
LESS THAN (TO_DAYS (‘2013-05-01 00:00:00’) ), gMORES VALUES LESS THAN
(MAXVALUE) );

C.
ALTER TABLE games SPLIT PARTITION (gMORES) INTO g201305 VALUES LESS

THAN (TO_DAYS (‘2013-05-01 00:00:00’) ), gMORES VALUES LESS THAN (MAXVALUE)
);

D.
ALTHER TABLE games DROP PATITION gMORES, ADD PARTITION g201305
VALUES LESS THAN (TO_DAYS (‘2013-05-01 00:00:00’) ), gMORES VALUES LESS
THAN (MAXVALUE) );

E.
ALTER TABLE games REORGANIZE PARTITION (gMORES) INTO g01305 VALUES
LESS THAN (TO_DAYS (‘2013-05-01 00:00:00’) ), gMORES VALUES LESS THAN
(MAXVALUE) );



Leave a Reply 2

Your email address will not be published. Required fields are marked *