An error occurred when I was creating Hash index in the column store table.
CREATE DATABASE `test`;
CREATE TABLE `test`.`tb_emp_modi_log1`(
`serialNo` INT AUTO_INCREMENT,
`empCode` VARCHAR(10) NOT NULL,
`startDate` VARCHAR(10) NOT NULL,
`endDate` VARCHAR(10) NOT NULL,
`posiCode` VARCHAR(5) NULL,
`regEmpCode` VARCHAR(10) NOT NULL DEFAULT 'ADMIN',
`regDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
`modiEmpCode` VARCHAR(10) NOT NULL DEFAULT 'ADMIN',
`modiDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
SHARD KEY (`empCode`),
PRIMARY KEY (`serialNo` ASC, `empCode` ASC),
KEY `idx_emp_modi_log_start_end_INC`(`startDate` ASC, `endDate` ASC, `empCode`, `posiCode`) USING HASH,
KEY(`regDate`) USING CLUSTERED COLUMNSTORE );
CREATE TABLE `test`.`tb_emp_modi_log2`(
`serialNo` INT AUTO_INCREMENT,
`empCode` VARCHAR(10) NOT NULL,
`startDate` VARCHAR(10) NOT NULL,
`endDate` VARCHAR(10) NOT NULL,
`posiCode` VARCHAR(5) NULL,
`regEmpCode` VARCHAR(10) NOT NULL DEFAULT 'ADMIN',
`regDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
`modiEmpCode` VARCHAR(10) NOT NULL DEFAULT 'ADMIN',
`modiDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
SHARD KEY (`empCode`),
PRIMARY KEY (`serialNo` ASC, `empCode` ASC),
KEY(`regDate`) USING CLUSTERED COLUMNSTORE );
CREATE INDEX `idx_emp_modi_log_start_end_INC` ON `test`.`tb_emp_modi_log2` (`startDate` ASC, `endDate` ASC, `empCode`, `posiCode`) USING HASH;
When an index is specified in [CREATE TABLE] DDL like tb_emp_modi_log1, the index was generated normally.
However, if I add Hash Index after creating a table like tb_emp_modi_log2, it wasn’t generated and the following error message was output.
SQL Error [2560] [HY000]: (conn=8999) Feature 'Adding an INDEX with multiple columns on a columnstore table where any column in the new index is already in an index' is not supported by SingleStore. As a workaround, please drop single column keys from each column first.
Did I write the wrong query(CREATE INDEX)?
Please check it out.