Restrictions on Functions of MySQL partition tables

Source: Internet
Author: User
Tags mysql index

MySQL partition tables have their own limitations. The following describes the restrictions on Functions of MySQL partition tables. If you are interested in MySQL partition tables, take a look.

MySQL Partition Table restrictions on Functions
In the statement for creating a partition table in mysql5.1, a MySQL Partition Table can only contain the following functions:
ABS ()
CEILING () and FLOOR () when using these two functions to create a partition table, the premise is that the partition key of the function is INT type), such

 
 
  1. mysql> CREATE TABLE t (c FLOAT) PARTITION BY LIST( FLOOR(c) )(  
  2.     -> PARTITION p0 VALUES IN (1,3,5),  
  3.     -> PARTITION p1 VALUES IN (2,4,6)  
  4.     -> );;  
  5. ERROR 1491 (HY000): The PARTITION function returns the wrong type   
  6.  
  7. mysql> CREATE TABLE t (c int) PARTITION BY LIST( FLOOR(c) )(  
  8.     -> PARTITION p0 VALUES IN (1,3,5),  
  9.     -> PARTITION p1 VALUES IN (2,4,6)    -> );  
  10. Query OK, 0 rows affected (0.01 sec)  
  11.  

DAY ()
DAYOFMONTH ()
DAYOFWEEK ()
DAYOFYEAR ()
DATEDIFF ()
EXTRACT ()
HOUR ()
MICROSECOND ()
MINUTE ()
MOD ()
MONTH ()
QUARTER ()
SECOND ()
TIME_TO_SEC ()
TO_DAYS ()
WEEKDAY ()
YEAR ()
YEARWEEK ()

Advantages and disadvantages of MySQL row-Level Lock

In-depth discussion on MySQL Lock Mechanism

Enumeration in the MySQL Field

MySQL Field Length

Provides you with an in-depth understanding of MySQL index types

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.