MySQL Forums
Forum List  »  Partitioning

Re: How to specify partition name while insert
Posted by: Phil Hildebrand
Date: April 27, 2008 08:35PM

Currently, I don't belive there's a way to specify a specific partition while doing inserts... MySQL takes care of that for you via the partition key.

At some point (I hope) we will be able to 'switch' partitions for tables, and thus have the ability to load a set of data into a table and then quickly switch it for an existing partition, but that's not available in 5.1 or 6.0.

When you insert a row into a partitoned table, MySQL will insert the row into the partition for which partition key evaluates to.

So, if you have multiple inserts, each statement will be evaluated separately by MySQL for which partition the row should end up in (no need for you to explain which partition).

So, just your typical insert:

insert into mytable (x,y,z) values (x,y,z);

will insert the new row into the appropriate partition for you.

Options: ReplyQuote

Written By
Re: How to specify partition name while insert
April 27, 2008 08:35PM

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.