MySQL Forums
Forum List  »  Partitioning

Re: not able to create multi column partition keys
Posted by: Mattias Jonsson
Date: December 02, 2010 10:31AM

Hi,

You are correct that you cannot use any expression in COLUMNS partitioning, only columns of supported types, see:
http://dev.mysql.com/doc/refman/5.5/en/partitioning-columns.html
for columns and:
http://dev.mysql.com/doc/refman/5.5/en/partitioning-columns-range.html
for not accepting expression, only column names.

I suggest that you use RANGE COLUMNS (id, d) instead, like:
CREATE TABLE t101 (id INT, d DATETIME)
PARTITION BY RANGE COLUMNS (id, d)
(PARTITION p001 VALUES LESS THAN (1, '2001-01-01'),
PARTITION p002 VALUES LESS THAN (2, '2001-02-01'));

Or do you want to only allow certain dates into the table? (Which the LIST partitioning scheme would give you, i.e. only allowing DATETIME values for the first of each month.)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: not able to create multi column partition keys
1536
December 02, 2010 10:31AM


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.