MySQL Forums
Forum List  »  Partitioning

Re: Proactive partitioning by Week
Posted by: Jonathan Stephens
Date: June 12, 2007 12:01AM

You can't partition by RANGE (which I assume is what you're after) explicitly on a DATE column - you need to use a function that acts on a DATE returns an integer value. Something like WEEK() or YEARWEEK() will work, but only the functions TO_DAYS() and YEARS() are optimised in MySQL 5.1. See http://dev.mysql.com/doc/refman/5.1/en/partitioning-types.html for more info.

You also need to take into consideration the rules regarding primary/unique keys and partitioning keys: http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html

Thanks!

Jon Stephens
MySQL Documentation Team @ Oracle
Orlando, Florida, USA

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Views
Written By
Posted
4723
June 08, 2007 04:14PM
Re: Proactive partitioning by Week
3052
June 12, 2007 12:01AM
2835
June 13, 2007 11:14AM
3003
July 02, 2007 01:46PM
2908
July 03, 2007 08:43AM


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.