Hello, I'd like to have some advice about partitioning. I have a database with several tables like this one:CREATE TABLE `my_timeranges_table` ( `id` INT(11), `time_range_beg` INT UNSIGNED, `time_range_end` INT UNSIGNED, <plus some irrelevant data fields>, PRIMARY KEY (`id`,`time_range_beg`), KEY `time_range_end` (`time_range_end`) ) ENGINE=MyISAM PARTITION BY RANGE (`time_range_beg`) (<some partitioning scheme>); Each row on these tables are expected to be unique for both `id`+`time_range_beg` fields, so I setup the primary key on this, but this could be `id`+`time_range_end` as well, knowing that the defined time ranges never overlap. Some of these tables are very big (currently 150,000,000 or even 500,000,000 rows), and they are constantly growing by the end. As they are not very efficient to query, I am trying several kinds of partitioning in order to find the most effective one. The problem is that, according to partition scheme, if I change the “PARTITION BY RANGE” field, I can get the following message: “A PRIMARY KEY must include all columns in the table's partitioning function”. I order to fix this, I need to change the primary key, for setting one including the field I want to use. But if I do, for example: ALTER TABLE `my_timeranges_table` DROP PRIMARY KEY, ADD PRIMARY KEY (`id`,`time_range_end`); I get the same error message because the partitioning is already set on the primary key that I want to drop before adding the new one. So what I actually have to do is the following: ALTER TABLE`my_timeranges_table` REMOVE PARTITIONING; ALTER TABLE `my_timeranges_table` DROP PRIMARY KEY, ADD PRIMARY KEY (`id`,`time_range_end`); ALTER TABLE`my_timeranges_table` PARTITION BY RANGE (`time_range_end`) (<new partitioning scheme>); But if I do this, as my tables are very big, this implies copying all of their contents on each statement, which may need about *several hours* for *each* (on a not very performant computer, I admit). In order to do it more quickly, I tried: ALTER TABLE`my_timeranges_table` REMOVE PARTITIONING, DROP PRIMARY KEY, ADD PRIMARY KEY (`id`,`time_range_end`), PARTITION BY RANGE (`time_range_end`) (<new partitioning scheme>); But unfortunately, this doesn't work: MariaDB doesn't seem to accept changing partitions and index keys in the same statement (despite the fact that the ALTER statement definition <https://mariadb.com/kb/en/alter-table/> syntax would theoretically allow it). Thus I get another error message. So I have some questions: 1. Is it really impossible to combine all these changes into a single statement, in order to copy the table only once, and save a lot of hours? Or is this planned to some future version? 2. It is said that all columns in a table's partitioning function have to be included in a primary key. Is this really necessary? Couldn't it just have to be included in any existing index key, not necessarily the primary one? Because of course, I cannot have several primary keys. But if I could have more than one kind of index keys for sustaining partitioning, at least I could add the needed one along with the primary key, and then reduce the needed statements to execute at the number of two, thus copying the table only twice. I'm not sure if this message was a question or a feature request. Regards, Gingko