You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/12/17 12:09:36 UTC

[GitHub] [incubator-doris] yangzhg opened a new issue #2487: [PROPOSAL] Supporting create index syntax on V2 segment

yangzhg opened a new issue #2487: [PROPOSAL] Supporting create index syntax on V2 segment
URL: https://github.com/apache/incubator-doris/issues/2487
 
 
   ## Motivation
   Doris currently supports bitmap indexes in the v2 segment, but there is no corresponding syntax support. Therefore, we need to implement the  create index, drop index, and management index syntax support. 
   The implementation is divided into two steps. The first step is to implement the front-end syntax support. The second step is to implement the index creation task and index management function.
   
   ## Syntax
   ### create table with index 
   ```
   CREATE TABLE table1
   (
       siteid INT DEFAULT '10',
       citycode SMALLINT,
       username VARCHAR(32) DEFAULT '',
       pv BIGINT SUM DEFAULT '0'
   )
   AGGREGATE KEY(siteid, citycode, username)
   DISTRIBUTED BY HASH(siteid) BUCKETS 10
   INDEX index_name [USING BITMAP] (siteid, citycode) COMMENT 'balabala'
   PROPERTIES("replication_num" = "1");
   ```
   ### create index 
   ```
   CREATE INDEX index_name  ON table1 (siteid, citycod) [USING BITMAP] COMMENT 'balabala';
   ```
   ### drop index
   ```
   DROP INDEX index_name ON table1;
   ```
   
   ### show index
   ```
   SHOW INDEX FROM table1
   ```
   output
   ```
   +---------+-------------+-----------------+------------+---------+
   | Table   | Index_name  | Column_name     | Index_type | Comment |
   +---------+-------------+-----------------+------------+---------+
   | table1  | index_name  | siteid,citycode | BITMAMP    | balabala|
   +---------+-------------+-----------------+------------+---------+
   ```
   
   ## Compromise
   Because bitmap indexes are only supported on a single column, joint indexes and expressions are not supported. Although multi-column indexes can be converted to indexes that act on a single column, in order to avoid inconvenience when creating a multi-column index, but you want to delete a column index separately. so currently each statement that creates a bitmap index can only work on a single column

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org