MySQL Forums
Forum List  »  Partitioning

Partition by Key
Posted by: Vanco Josifovski
Date: March 09, 2010 02:28AM

Dear Sir/Madam,

I have the following table:

CREATE TABLE store.products (
pyear int(10) unsigned NOT NULL AUTO_INCREMENT,
pmonth int(10) unsigned NOT NULL,
pname varchar(45) COLLATE latin1_german1_ci NOT NULL,
pprice int(10) unsigned NOT NULL,
PRIMARY KEY (pyear,pmonth)
) ENGINE=MyISAM DEFAULT CHARSET latin1 COLLATE latin1_german1_ci AX_ROWS=150000000
PARTITION BY KEY(pyear,pmonth)
PARTITIONS 100;

And the folowing statement:

INSERT INTO tmp_insight.products (pyear,pmonth,pname,pprice)
VALUES (2007,1,'AJVAR',10);

Question:?

Which partition will contain my data?

I want later to say: ALTER TABLE store.products DROP PARTITION (PARTITION_NAME);

How can i find the partition_name for the data containing pyear=2007 and pmonth=1?

Thank you,

Josifovski

Options: ReplyQuote


Subject
Views
Written By
Posted
Partition by Key
5814
March 09, 2010 02:28AM
2149
March 12, 2010 02:17AM


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.