Get the App
SLTechnology News&Howtos  ›  Database  › 

How does the Sequoiadb database modify the storage engine to Sequoiadb for tables with the same primary key and unique index key?

Shulou Source: shulou.com Published: 2022-05-31 18:15:54 10月02日 Update

This article mainly explains how Sequoiadb database modifies the storage engine to Sequoiadb for tables with the same primary key and unique index key. Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "Sequoiadb database how to modify the storage engine to Sequoiadb for tables with the same primary key and unique index key"!

[Problem Description]

Connect mysql instances with Nivacat. Import a batch of tables via data transfer and modify the engine for these tables to sequoiadb. One of them failed to modify the table, error 40291 from storage engine.

The table statement is:

CREATE TABLE 'sys_district'(

'id' int(11) NOT NULL COMMENT 'three-level linkage-district county-level table',

'city_id' int(11) DEFAULT NULL COMMENT 'city id',

'district_name' varchar(100) DEFAULT NULL COMMENT 'district name',

'short_name' varchar(40) DEFAULT NULL COMMENT 'short',

'create_time' varchar(40) DEFAULT NULL COMMENT 'create time',

'update_time' varchar(40) DEFAULT NULL COMMENT 'update time',

PRIMARYKEY('id'),

UNIQUE KEY 'sys_district_id' ('id') USING BTREE,

KEY 'sys_district_city_id' ('city_id') USING BTREE,

KEY 'sys_district_distruct_name' ('distruct_name') USING BTREE

ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='District County-level table;

[Solution]

40291 Error-291 for Sequoiadb (-291: There is already an index that can handle this scene).

As can be seen from the table creation statement, the primary key 'id'(PRIMARYKEY ('id ')) and the unique index'id'(UNIQUE KEY 'sys_district_id'('id') are duplicates.

At this point, I believe everyone has a deeper understanding of "Sequoiadb database how to modify the storage engine for Sequoiadb tables with the same primary key and unique index key." Let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: Index engine data same database storage content district county time sentence learning practical deeper interest method name region name city Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi OPPO Reno Xiaomi MariaDB NVidia