Mysql partition Table

Source: Internet
Author: User

DROP TABLE IF EXISTS ' frank_test ';
CREATE TABLE ' Frank_test ' (
' ID ' bigint () not NULL auto_increment COMMENT ' primary key ID ',
' gid ' bigint DEFAULT ' 0 ' COMMENT ' base table ID ',
' Frankly_code ' varchar (+) DEFAULT ' COMMENT ' Bill of lading number ',
' Total_amount ' bigint (0) DEFAULT ' Total number of products ' COMMENT ',
' Total_weight ' double (15,3) DEFAULT ' 0.000 ' COMMENT ' total weight ',
' Weight_unit ' varchar (DEFAULT ' T ' COMMENT ' weight unit '),
' Total_volume ' decimal (20,3) DEFAULT ' 0.000 ' COMMENT ' total volume ',
' Volume_unit ' varchar (DEFAULT ' TEU ' COMMENT ' volume units '),
' businesses_id ' bigint (DEFAULT ' 0 ' COMMENT ' Purchaser ID '),
' Businesses_name ' varchar (255) DEFAULT ' COMMENT ' purchaser name ',
' businesses_did ' varchar DEFAULT ' 0 ' COMMENT ' buyer address ID ',
' businesses_address ' varchar DEFAULT ' COMMENT ' buyer details address ',
' suppliers_id ' bigint () DEFAULT ' 0 ' COMMENT ' Supplier ID ',
' Suppliers_name ' varchar (+) DEFAULT ' COMMENT ' supplier name ',
' suppliers_did ' varchar DEFAULT ' 0 ' COMMENT ' Supplier address ID ',
' suppliers_address ' varchar DEFAULT ' COMMENT ' Supplier details address ',
' Product_description ' longtext COMMENT ' product description ',
' Frankly_time ' datetime DEFAULT NULL COMMENT ' Bill of lading date ',
' contact_id ' bigint (DEFAULT ' 0 ' COMMENT ' notifier id '),
' contact_name ' varchar DEFAULT ' COMMENT ' notice person name ',
' Create_time ' datetime DEFAULT current_timestamp COMMENT ' creation time ',
' Update_time ' datetime DEFAULT current_timestamp COMMENT ' modified time ',
' is_deleted ' int (one) DEFAULT ' 0 ' COMMENT ' whether delete 0 = normal, 1 = delete ',
' qiyun_prot_id ' bigint (one) DEFAULT ' 0 ' COMMENT ' Port ID ',
' Qiyun_prot_name ' varchar ($) DEFAULT NULL COMMENT ' port name ',
' mudi_prot_id ' bigint (one) DEFAULT ' 0 ' COMMENT ' Port of destination ID ',
' Mudi_prot_name ' varchar ($) DEFAULT ' COMMENT ' Port of destination name ',
' mudi_country ' varchar DEFAULT ' COMMENT ' destination country ',
' Mudi_district_did ' bigint (one) DEFAULT ' 0 ' COMMENT ' Destination country ID ',
' Fact_weight ' double (15,3) DEFAULT ' 0.000 ' COMMENT ' actual weight (after conversion) ',
' originer_country ' varchar (+) DEFAULT ' COMMENT ' country of origin ',
' originer_country_id ' bigint (0 ') DEFAULT ' COMMENT ' country of Origin ID ',
' Vessel_name ' varchar (+) DEFAULT ' COMMENT ' carrier name ',
' vessel_id ' bigint (one) DEFAULT ' 0 ' COMMENT ' carrier ID ',
' hs_code ' varchar DEFAULT ',
PRIMARY KEY (' id ', frankly_time),
KEY ' qiyun_prot_id ' (' qiyun_prot_id ') USING BTREE,
KEY ' businesses_id ' (' businesses_id ') USING BTREE,
KEY ' suppliers_id ' (' suppliers_id ') USING BTREE,
KEY ' Key_total_volume ' (' Total_volume ') USING BTREE,
KEY ' key_fact_weight ' (' fact_weight ') USING BTREE,
KEY ' Key_time ' (' frankly_time ') USING BTREE,
KEY ' Key_hscode ' (' Hs_code ') USING BTREE,
KEY ' Key_suppliers_did ' (' Suppliers_did ') USING BTREE,
KEY ' Key_businesses_did ' (' Businesses_did ') USING BTREE,
KEY ' Key_busi ' (' Hs_code ', ' frankly_time ', ' businesses_did ', ' businesses_name ') USING BTREE,
KEY ' Key_supp ' (' Hs_code ', ' frankly_time ', ' suppliers_did ', ' suppliers_name ') USING BTREE
) Engine=myisam auto_increment=1 DEFAULT Charset=utf8 comment= ' Bill of lading information Form '
PARTITION by RANGE (year (frankly_time))
(
PARTITION frank08 VALUES less THAN ENGINE = MyISAM,
PARTITION frank10 VALUES less THAN () ENGINE = MyISAM,
PARTITION frank11 VALUES less THAN () ENGINE = MyISAM,
PARTITION frank12 VALUES less THAN ENGINE = MyISAM,
PARTITION frank13 VALUES less THAN ENGINE = MyISAM,
PARTITION frank14 VALUES less THAN ENGINE = MyISAM,
PARTITION frank15 VALUES less THAN ENGINE = MyISAM,
PARTITION frank16 VALUES less THAN ENGINE = MyISAM,
PARTITION frank17 VALUES less THAN MAXVALUE ENGINE = MyISAM);

Mysql partition Table

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.