In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Next, let's learn about how to create partition tables in MySQL database management. I believe you will benefit a lot after reading it. The text is not much in essence. I hope MySQL database management how to create partition tables is what you want.
Create a partition table mysql > CREATE TABLE `LINEITEM` (L_SHIPDATE DATE NULL,L_ORDERKEY INT NOT NULL,L_DISCOUNT DECIMAL (10Magne2) NOT NULL,L_EXTENDEDPRICE DECIMAL (10Magne2) NOT NULL,L_SUPPKEY INT NOT NULL,L_QUANTITY INT NOT NULL,L_RETURNFLAG CHAR (1) BINARY NULL,L_PARTKEY INT NOT NULL,L_LINESTATUS CHAR (1) BINARY NULL,L_TAX DECIMAL (10LINEITEM`) NOT NULL,L_COMMITDATE DATE NULL,L_RECEIPTDATE DATE NULL,L_SHIPMODE CHAR (10) BINARY NULL,L_LINENUMBER INT NOT NULL L_SHIPINSTRUCT CHAR (25) BINARY NULL,L_COMMENT VARCHAR (44) BINARY NULL,PRIMARY KEY (`LODERKEY`, `LINENUMBER`, `LSHIPDATE`) PARTITION BY RANGE COLUMNS (L_SHIPDATE) (PARTITION p0 VALUES LESS THAN ('1993-01-01'), PARTITION p1 VALUES LESS THAN ('1994-01-01'), PARTITION p2 VALUES LESS THAN ('1995-01-01'), PARTITION p3 VALUES LESS THAN ('1996-01-01'), PARTITION p4 VALUES LESS THAN ('1997-01-01') PARTITION p5 VALUES LESS THAN ('1998-01-01'), PARTITION p6 VALUES LESS THAN ('1999-01-01'), PARTITION p7 VALUES LESS THAN (MAXVALUE)) delete mysql > ALTER TABLE lineitem DROP PARTITION p7 Add mysql > ALTER TABLE lineitem ADD PARTITION (PARTITION p7 VALUES LESS THAN ('2000-01-01')); split mysql > ALTER TABLE lineitem REORGANIZE PARTITION p0 INTO (PARTITION p199206 VALUES LESS THAN ('1992-07-01'), PARTITION p199212 VALUES LESS THAN ('1993-01-01'); merge mysql > ALTER TABLE lineitem REORGANIZE PARTITION p199206 INTO (PARTITION p0 VALUES LESS THAN ('1993-01-01')) Exchange partition mysql > CREATE TABLE `temp1992` (`L_ SHIPDATE` date NOT NULL DEFAULT '0000-00-0000), `L_ ORDERKEY` int (11) NOT NULL, `L_ DISCOUNT` decimal (10Mab 2) NOT NULL, `LEXTENDEDPRICE` decimal (10Ma2) NOT NULL, `LSUPPKEY` int (11) NOT NULL, `LQUANTITY` int (11) NOT NULL, `LRETURNFLAG` char (1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `L_ PARTKEY` int (11) NOT NULL, `LLINESTATUS` char (1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL `L_ TAX` decimal (10Power2) NOT NULL, `L_ COMITDATE` date DEFAULT NULL, `L_ RECEIPTDATE` date DEFAULT NULL, `L_ SHIPMODE` char (10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `LLINENUMBER` int (11) NOT NULL, `LSHIPINSTRUCT` char (25) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `LCOMMENT` varchar (44) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`LORDERKY`, `LLINENUMBER`, `LSHIPDATE`) ENGINE=InnoDB DEFAULT CHARSET=utf8mysql > ALTER TABLE lineitem EXCHANGE PARTITION Query OK, 0 rows affected (0.24 sec)
After reading this article on how to create partition tables in MySQL database management, many readers will want to know more about it. For more industry information, you can follow our industry information section.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.