Getting error - "Column usage mismatch" when splitting a table

I have a table ee_company_product_listings_par

that has many columns including cplc_id

and marketplaceID

.

These are the DDLs of the tables: -

ee_company_product_listings_par | CREATE TABLE `ee_company_product_listings_par` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `company_product_id` int(11) DEFAULT NULL,
    `feed_dump_id` int(11) DEFAULT NULL,
    `listing_status_id` int(11) DEFAULT NULL,
    `sku` varchar(500) DEFAULT NULL,
    `mrp` float DEFAULT NULL,
    `selling_price` float DEFAULT NULL,
    `quantity` int(11) NOT NULL,
    `merchant_payout` float DEFAULT NULL,
    `shipping_cost` float DEFAULT NULL,
    `commission` float DEFAULT NULL,
    `commission_service_tax` float DEFAULT NULL,
    `pmt_gateway_charge` float DEFAULT NULL,
    `shipping_local` float DEFAULT NULL,
    `shipping_zonal` float DEFAULT NULL,
    `shipping_national` float DEFAULT NULL,
    `site_uid` varchar(200) DEFAULT '-',
    `listing_ref_number` varchar(200) DEFAULT '-',
    `UID` varchar(50) DEFAULT NULL,
    `marketplaceID` int(11) NOT NULL,
    `confirmed` tinyint(1) NOT NULL DEFAULT '0',
    `inventory_live` tinyint(2) NOT NULL DEFAULT '1',
    `update_cpl_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `sku_corrected` tinyint(1) DEFAULT '0',
    `cplisting_entry_time` timestamp NULL DEFAULT NULL,
    `weight` float(10,2) DEFAULT NULL,
    `length` float(10,2) DEFAULT NULL,
    `height` float(10,2) DEFAULT NULL,
    `width` float(10,2) DEFAULT NULL,
    `cplc_id` int(11) NOT NULL DEFAULT '0',
    `mp_cat_id` int(11) DEFAULT NULL,
    `process_id` varchar(10) DEFAULT NULL,
    `host_ip` varchar(20) DEFAULT NULL,
    `color` varchar(100) DEFAULT NULL,
    `size` varchar(100) DEFAULT NULL,
    `identifier` varchar(200) DEFAULT NULL,
    `mp_brand_id` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`,`cplc_id`,`marketplaceID`)
) ENGINE=InnoDB AUTO_INCREMENT=21474383 DEFAULT CHARSET=latin1 |

      

Range cplc_id

is 0-10000 Range marketplaceID

is 0-100

I want to create Range partitions based on these two columns.

This was the request I am running: -

alter table ee_company_product_listings_par partition by range columns (cplc_id, marketplaceID) (
PARTITION p500_5 VALUES LESS THAN (500, 5),
PARTITION p500_10 VALUES LESS THAN (500,10),
PARTITION p1000_5 VALUES LESS THAN (1000,5),
PARTITION p1000_10 VALUES LESS THAN (1000,10),
partition pmax values less than MAXVALUE
);

      

This is the error I am getting: -

ERROR 1064 (42000): Inconsistency in usage of column lists for partitioning near 'MAXVALUE
)' at line 4

      

Can someone help find what is the problem in the request. Searched all over the internet but couldn't find a solution. There might be some silly mistake as I am completely new to separation. Any help would be appreciated.

+3


source to share


1 answer


Syntax error; use this:

VALUES LESS THAN (MAXVALUE, MAXVALUE)

      



What do you expect to get from PARTITIONing

? What can it bring SELECTs

?

+1


source







All Articles