Опытный
Профиль
Группа: Участник
Сообщений: 290
Регистрация: 14.2.2007
Репутация: нет Всего: 0
|
Есть таблица: Код | CREATE TABLE flights_2019 ( `key` CHAR(32) NOT NULL, trip_class ENUM ('0', '1', '2') NOT NULL, origin CHAR(3) NOT NULL, origin_id SMALLINT(5) UNSIGNED NULL, destination_id SMALLINT(5) UNSIGNED NULL, destination CHAR(3) NOT NULL, depart_date DATE NOT NULL, return_date DATE NOT NULL, number_of_changes ENUM ('0', '1', '2') NOT NULL, value MEDIUMINT NOT NULL, distance SMALLINT(6) NOT NULL, destination_country_code CHAR(2) NOT NULL, airlines_iata VARCHAR(255) NOT NULL, airlines TEXT NOT NULL, alliances VARCHAR(255) NOT NULL, date_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, origin_country_code CHAR(2) DEFAULT '' NOT NULL, depart_date_month ENUM ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12') NOT NULL, depart_date_month_ TINYINT UNSIGNED DEFAULT '0' NOT NULL, date_found DATE NOT NULL, destination_country_id TINYINT UNSIGNED NULL, origin_country_id TINYINT UNSIGNED NULL, destination_continent_id TINYINT UNSIGNED NULL, CONSTRAINT key_depart_date_month_ UNIQUE (`key`, depart_date_month_), CONSTRAINT `key` UNIQUE (`key`) ) ENGINE = InnoDB;
CREATE INDEX origin_destination_return_date_depart_date_month ON flights_2019 (origin, destination, return_date, depart_date_month);
CREATE INDEX origin_destination_date_update ON flights_2019 (origin, destination, date_update);
CREATE INDEX origin_id_destination_id_return_date_depart_date_month ON flights_2019 (origin_id, destination_id, return_date, depart_date_month);
CREATE INDEX origin_id_destination_id_return_date_depart_date_month_ ON flights_2019 (origin_id, destination_id, return_date, depart_date_month_);
CREATE INDEX origin_id_destination_id_date_update ON flights_2019 (origin_id, destination_id, date_update);
CREATE INDEX origin_id_date_update ON flights_2019 (origin_id, date_update);
CREATE INDEX destination_id_date_update ON flights_2019 (destination_id, date_update);
CREATE INDEX destination_destination_country_code_ ON flights_2019 (destination, destination_country_code);
CREATE INDEX origin_country_id_return_date_date_update ON flights_2019 (origin_country_id, return_date, date_update);
|
Пытаюсь добавить патицию Код | ALTER TABLE flights_2019 PARTITION BY LIST (depart_date_month_) ( PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2), PARTITION p3 VALUES IN (3), PARTITION p4 VALUES IN (4), PARTITION p5 VALUES IN (5), PARTITION p6 VALUES IN (6), PARTITION p7 VALUES IN (7), PARTITION p8 VALUES IN (8), PARTITION p9 VALUES IN (9), PARTITION p10 VALUES IN (10), PARTITION p11 VALUES IN (11), PARTITION p12 VALUES IN (12) );
|
получаю ответ: ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function что не так? уже добавлял различные ключи - ничего не помогает
|