From e889cabb2e1c62247f4e90ff27e0228c9f6bb900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B5=B5=E7=A9=BA=E4=BA=8B=E3=82=B9=E3=83=94=E3=83=AA?= =?UTF-8?q?=E3=83=83=E3=83=88?= Date: Tue, 22 Oct 2024 14:51:55 +0800 Subject: [PATCH] [Doc] Fix EN CREATE INDEX reference (#52085) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 絵空事スピリット (cherry picked from commit aea84405ba5616a1c9f0d57cf7b0a99248e1b8ad) # Conflicts: # docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md --- .../table_bucket_part_index/CREATE_INDEX.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md 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 new file mode 100644 index 0000000000000..a31e2bd78b310 --- /dev/null +++ b/docs/en/sql-reference/sql-statements/table_bucket_part_index/CREATE_INDEX.md @@ -0,0 +1,58 @@ +--- +displayed_sidebar: docs +--- + +# CREATE INDEX + +## Description + +This statement is used to create indexes. You can use this statement to create only Bitmap indexes. For usage notes and scenarios of Bitmap indexes, see [Bitmap index](../../../table_design/indexes/Bitmap_index.md). + +:::tip + +This operation requires the ALTER privilege on the target table. You can follow the instructions in [GRANT](../account-management/GRANT.md) to grant this privilege. + +::: + +## Syntax + +```SQL +CREATE INDEX index_name ON table_name (column_name) [USING BITMAP] [COMMENT''] +``` + +## Parameter + +| **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 + +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 + +- [SHOW INDEX](SHOW_INDEX.md) +- [DROP INDEX](DROP_INDEX.md)