You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/08/23 07:28:54 UTC

[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1025: IGNITE-17505 Add documentation for INDEX commands

korlov42 commented on code in PR #1025:
URL: https://github.com/apache/ignite-3/pull/1025#discussion_r952239435


##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,60 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 ----
 
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+(column_name [ASC | DESC]
+[NULLS {FIRST | LAST}]);
+----
+
+Parameters:
+
+* `name` - name of the index.
+* `tableName` - name of the table to create the index on.
+* `USING` - specifies whether the command creates a B+ Tree index or a hash index. Possible values: `HASH`, `TREE`.

Review Comment:
   ```suggestion
   * `USING` - specifies whether the command creates a sorted index or a hash index. Possible values: `HASH`, `TREE`.
   ```



##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,60 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 ----
 
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+(column_name [ASC | DESC]

Review Comment:
   Specification should reflect the fact that index might consists of several columns



##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,60 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 ----
 
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+(column_name [ASC | DESC]
+[NULLS {FIRST | LAST}]);
+----
+
+Parameters:
+
+* `name` - name of the index.
+* `tableName` - name of the table to create the index on.
+* `USING` - specifies whether the command creates a B+ Tree index or a hash index. Possible values: `HASH`, `TREE`.
+* `column_name` - specifies whether column names will be sorted in ascending or descending order. Possible values: `ASC`, `DESC`.
+* `NULLS` - specifies whether null values will be at the start or at the end of the index. Possible values: `FIRST`, `LAST`.
+
+
+
+Examples:
+
+Create index Persons for Person table:
+
+[source,sql]
+----
+CREATE INDEX IF NOT EXISTS Persons ON Person

Review Comment:
   this example is invalid because at least one column should be specified



##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,60 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 ----
 
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+(column_name [ASC | DESC]
+[NULLS {FIRST | LAST}]);
+----
+
+Parameters:

Review Comment:
   param `IF NOT EXISTS` is missed



##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,60 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 ----
 
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+(column_name [ASC | DESC]
+[NULLS {FIRST | LAST}]);
+----
+
+Parameters:
+
+* `name` - name of the index.
+* `tableName` - name of the table to create the index on.
+* `USING` - specifies whether the command creates a B+ Tree index or a hash index. Possible values: `HASH`, `TREE`.
+* `column_name` - specifies whether column names will be sorted in ascending or descending order. Possible values: `ASC`, `DESC`.

Review Comment:
   this line doesn't make any sense. `column_name` specifies which column of table of origin should be indexed, whereas `ASC` and `DESC` specifies in which order this column should be sorted



##########
docs/_docs/sql-reference/ddl.adoc:
##########
@@ -245,6 +245,60 @@ Drop Person table if the one exists:
 DROP TABLE IF EXISTS "Person";
 ----
 
+== CREATE INDEX
+
+Creates a new index.
+
+[source,sql]
+----
+CREATE INDEX [IF NOT EXISTS] name ON tableName
+[USING { HASH | TREE }]
+(column_name [ASC | DESC]
+[NULLS {FIRST | LAST}]);
+----
+
+Parameters:
+
+* `name` - name of the index.
+* `tableName` - name of the table to create the index on.
+* `USING` - specifies whether the command creates a B+ Tree index or a hash index. Possible values: `HASH`, `TREE`.
+* `column_name` - specifies whether column names will be sorted in ascending or descending order. Possible values: `ASC`, `DESC`.
+* `NULLS` - specifies whether null values will be at the start or at the end of the index. Possible values: `FIRST`, `LAST`.
+
+
+
+Examples:
+
+Create index Persons for Person table:
+
+[source,sql]
+----
+CREATE INDEX IF NOT EXISTS Persons ON Person
+----
+
+== DROP INDEX
+
+[source,sql]
+----
+DROP INDEX [IF EXISTS] indexName;
+----
+
+Parameters:
+
+- indexName - the name of the index.
+- `IF EXISTS` - do not throw an error if an index with the specified name does not exist.
+
+
+
+Examples:
+
+Drop Person table if the one exists:

Review Comment:
   drop index, actually 



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org