[improvement] create/drop index support if [not] exist (#7748)

create or drop index clause support if [not] exist
This commit is contained in:
shee
2022-01-16 10:40:44 +08:00
committed by GitHub
parent 5b0f11b665
commit 8b7d7e4dac
13 changed files with 71 additions and 35 deletions

View File

@ -231,13 +231,13 @@ under the License.
Bitmap index supports the following modifications:
1. create bitmap index
grammar:
ADD INDEX index_name (column [, ...],) [USING BITMAP] [COMMENT 'balabala'];
ADD INDEX [IF NOT EXISTS] index_name (column [, ...],) [USING BITMAP] [COMMENT 'balabala'];
note:
1. only supports bitmap index for current version
2. BITMAP index only supports apply on single column
2. drop index
grammar:
DROP INDEX index_name;
DROP INDEX [IF EXISTS] index_name;
## example
@ -418,9 +418,9 @@ under the License.
[index]
1. create index on table1 column siteid using bitmap
ALTER TABLE table1 ADD INDEX index_name [USING BITMAP] (siteid) COMMENT 'balabala';
ALTER TABLE table1 ADD INDEX [IF NOT EXISTS] index_name [USING BITMAP] (siteid) COMMENT 'balabala';
2. drop bitmap index of table1
ALTER TABLE table1 DROP INDEX index_name;
ALTER TABLE table1 DROP INDEX [IF EXISTS] index_name;
## keyword

View File

@ -30,7 +30,7 @@ under the License.
This statement is used to create index
grammer:
CREATE INDEX index_name ON table_name (column [, ...],) [USING BITMAP] [COMMENT'balabala'];
CREATE INDEX [IF NOT EXISTS] index_name ON table_name (column [, ...],) [USING BITMAP] [COMMENT'balabala'];
note:
1. only support bitmap index in current version
2. BITMAP index only supports apply to single column
@ -38,7 +38,7 @@ under the License.
## example
1. create index on table1 column siteid using bitmap
CREATE INDEX index_name ON table1 (siteid) USING BITMAP COMMENT 'balabala';
CREATE INDEX [IF NOT EXISTS] index_name ON table1 (siteid) USING BITMAP COMMENT 'balabala';
## keyword

View File

@ -30,7 +30,7 @@ under the License.
This statement is used to delete index from table
grammer:
DROP INDEX index_name ON [db_name.]table_name;
DROP INDEX [IF EXISTS] index_name ON [db_name.]table_name;
## keyword