From d9b8c1ef92cc4d2b3558f9502ff34f1a8b8dd9d7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:00:21 +0800 Subject: [PATCH] [Doc] Fix EN CREATE INDEX reference (backport #52085) (#52193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 絵空事スピリット --- .../table_bucket_part_index/CREATE_INDEX.md | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md b/docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md index 91f4f7fcb167d..a31e2bd78b310 100644 --- a/docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md +++ b/docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md @@ -16,19 +16,43 @@ This operation requires the ALTER privilege on the target table. You can follow ## Syntax -```sql -CREATE INDEX index_name ON table_name (column [, ...],) [USING BITMAP] [COMMENT 'balabala'] +```SQL +CREATE INDEX index_name ON table_name (column_name) [USING BITMAP] [COMMENT''] ``` -Note: +## Parameter -1. For the naming conventions of indexes, see [System limits](../../System_limit.md). -2. One column can have only one BITMAP index. If a column already has an index, you cannot create one more index on it. +| **Parameter** | **Required** | **Description** | +| ------------- | -------------- | ---------------------------------------------------------------------------- | +| index_name | Yes | The index name. For naming conventions, see [System Limits](../../System_limit.md). | +| table_name | Yes | The name of the table. | +| column_name | Yes | The name of the column to build index on. One column can have only one BITMAP index. If a column already has an index, you cannot create one more index on it. | +| COMMENT | No | The comment for the index. | ## Examples -1. Create bitmap index for `siteid` on `table1`. +Create a table `sales_records` as follows: + +```SQL +CREATE TABLE sales_records +( + record_id int, + seller_id int, + item_id int +) +DISTRIBUTED BY hash(record_id) +PROPERTIES ( + "replication_num" = "3" +); +``` + +Create an index `index` on the `item_id` column of `sales_records`。 + +```SQL +CREATE INDEX index3 ON sales_records (item_id) USING BITMAP COMMENT ''; +``` + +## Relevant SQLs - ```sql - CREATE INDEX index_name ON table1 (siteid) USING BITMAP COMMENT 'balabala'; - ``` +- [SHOW INDEX](SHOW_INDEX.md) +- [DROP INDEX](DROP_INDEX.md)