You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by liuyu000 <gi...@git.apache.org> on 2018/04/26 09:01:30 UTC

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

GitHub user liuyu000 opened a pull request:

    https://github.com/apache/trafodion/pull/1542

    [TRAFODION-3044] Add Syntax and Examples of *ENABLE/DISABLE INDEX (ALTER TABLE Statement)* in Trafodion SQL Reference Manual

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/liuyu000/trafodion EnableIndex_AlterTableStatement

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafodion/pull/1542.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1542
    
----
commit 2f2c741f172d58cc4a28df01030ae30bba471bbe
Author: liu.yu <qw...@...>
Date:   2018-04-26T08:57:34Z

    Add Syntax and Examples of *ENABLE/DISABLE INDEX (ALTER TABLE Statement)* in Trafodion SQL Reference Manual

----


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184473670
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    --- End diff --
    
    Again, I would not make a distinction at this level between unique and non-unique indexes. Suggested wordsmith: "* _index-name_   <blank lines> is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name... <the rest of your text is fine>"


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184474045
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    +** _normal-index-name_
    ++
    +is equal to _index-name_, which is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name with its schema name. 
    +Indexes have their own name space within a schema, 
    +so an index name might be the same as a table or constraint name. However, no two indexes in a schema can have the same name.
    +
    +** _unique-index-name_
    ++
    +is the name of the unique index.
    +
    +* ENABLE INDEX _normal-index-name_ 
    --- End diff --
    
    Again, I would not distinguish between unique and non-unique indexes here. Simply say "ENABLE INDEX _index-name_ <blank lines> enables an index on the table" is sufficient.


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584460
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    +** _normal-index-name_
    ++
    +is equal to _index-name_, which is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name with its schema name. 
    +Indexes have their own name space within a schema, 
    +so an index name might be the same as a table or constraint name. However, no two indexes in a schema can have the same name.
    +
    +** _unique-index-name_
    ++
    +is the name of the unique index.
    +
    +* ENABLE INDEX _normal-index-name_ 
    --- End diff --
    
    Thanks @DaveBirdsall, I've udpated :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584468
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    +** _normal-index-name_
    ++
    +is equal to _index-name_, which is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name with its schema name. 
    +Indexes have their own name space within a schema, 
    +so an index name might be the same as a table or constraint name. However, no two indexes in a schema can have the same name.
    +
    +** _unique-index-name_
    ++
    +is the name of the unique index.
    +
    +* ENABLE INDEX _normal-index-name_ 
    ++
    +enables a normal index on the table.
    +
    +* ENALBE INDEX _unique-index-name_
    ++
    +enables an unique index on the table.
    +
    +* DISABLE ALL [UNIQUE] INDEXES
    +** DISABLE ALL UNIQUE INDEXES
    ++
    +disables all unique indexes on the table.
    +
    +** DISABLE ALL INDEXES
    ++
    +disables all indexes (including normal indexes and unique indexes) on the table.
    --- End diff --
    
    Thanks @DaveBirdsall, I've udpated :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184474355
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -716,6 +777,222 @@ Alter TABLE PRODUCT
     ALTER COLUMN vend_id RENAME TO cstm_id;
     ```
     
    +* The following table _orders_ has two normal indexes 
    +(_index_orders1_ and _index_orders2_) and 
    +two unique indexes (_unique_index_orders1_ and _unique_index_orders2_).
    +
    ++
    +```
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    SALESREP ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one unique index (_unique_index_orders1_) and verify that all normal indexes (_index_orders1_ and _index_orders2_)
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX unique_index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one normal index (_index_orders1_) and verify that the rest normal index (_index_orders2_) 
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable all indexes and verify that all indexes (including normal indexes and unique indexes) are disabled.
    --- End diff --
    
    Here too


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584409
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -442,6 +446,10 @@ ref-spec is:
     
     column-list is:
        column-name[, column-name]...
    +
    +index-name is:
    --- End diff --
    
    Thanks @DaveBirdsall, I've deleted. :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584414
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    --- End diff --
    
    Thanks @DaveBirdsall, agree with you that the word "non-unique" is more accurate. I've changed that. :)
    
    However, I read the term "normal indexes" in: 
    
    * [Oracle SQL Reference Manual](https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5010.htm): 
    
    > An index is a schema object that contains an entry for each value that appears in the indexed column(s) of the table or cluster and provides direct, fast access to rows. Oracle Database supports several types of index:
    Normal indexes. (By default, Oracle Database creates B-tree indexes.)
    Bitmap indexes, which store rowids associated with a key value as a bitmap
    ...
    
    > B-tree indexes
    These indexes are the standard index type. They are excellent for primary key and highly-selective indexes. Used as concatenated indexes, B-tree indexes can retrieve data sorted by the indexed columns.
    ...
    
    * [MySQL Reference Manual](https://dev.mysql.com/doc/refman/8.0/en/optimizing-spatial-analysis.html):
    
    > It is also possible to create normal indexes on spatial columns. In a non-SPATIAL index, you must declare a prefix for any spatial column except for POINT columns. 
    ...
    
    * [PostgreSQL Documentation](https://www.postgresql.org/docs/9.5/static/routine-vacuuming.html):
    > Second, it allows PostgreSQL to answer some queries using only the index, without reference to the underlying table. Since PostgreSQL indexes don't contain tuple visibility information, a normal index scan fetches the heap tuple for each matching index entry, to check whether it should be seen by the current transaction.
    ...


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584482
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -716,6 +777,222 @@ Alter TABLE PRODUCT
     ALTER COLUMN vend_id RENAME TO cstm_id;
     ```
     
    +* The following table _orders_ has two normal indexes 
    +(_index_orders1_ and _index_orders2_) and 
    +two unique indexes (_unique_index_orders1_ and _unique_index_orders2_).
    +
    ++
    +```
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    SALESREP ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one unique index (_unique_index_orders1_) and verify that all normal indexes (_index_orders1_ and _index_orders2_)
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX unique_index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one normal index (_index_orders1_) and verify that the rest normal index (_index_orders2_) 
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable all indexes and verify that all indexes (including normal indexes and unique indexes) are disabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE ALL INDEXES;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Enable all indexes on the table _orders_ and verify the result.
    +
    ++
    +```
    +SQL>ALTER TABLE orders ENABLE ALL INDEXES;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    SALESREP ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    --- End diff --
    
    Thanks @DaveBirdsall :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184474138
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    +** _normal-index-name_
    ++
    +is equal to _index-name_, which is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name with its schema name. 
    +Indexes have their own name space within a schema, 
    +so an index name might be the same as a table or constraint name. However, no two indexes in a schema can have the same name.
    +
    +** _unique-index-name_
    ++
    +is the name of the unique index.
    +
    +* ENABLE INDEX _normal-index-name_ 
    ++
    +enables a normal index on the table.
    +
    +* ENALBE INDEX _unique-index-name_
    ++
    +enables an unique index on the table.
    +
    +* DISABLE ALL [UNIQUE] INDEXES
    +** DISABLE ALL UNIQUE INDEXES
    ++
    +disables all unique indexes on the table.
    +
    +** DISABLE ALL INDEXES
    ++
    +disables all indexes (including normal indexes and unique indexes) on the table.
    --- End diff --
    
    Similar remarks here


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584455
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    --- End diff --
    
    Thanks @DaveBirdsall, I've udpated :)



---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184474193
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    +** _normal-index-name_
    ++
    +is equal to _index-name_, which is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name with its schema name. 
    +Indexes have their own name space within a schema, 
    +so an index name might be the same as a table or constraint name. However, no two indexes in a schema can have the same name.
    +
    +** _unique-index-name_
    ++
    +is the name of the unique index.
    +
    +* ENABLE INDEX _normal-index-name_ 
    ++
    +enables a normal index on the table.
    +
    +* ENALBE INDEX _unique-index-name_
    ++
    +enables an unique index on the table.
    +
    +* DISABLE ALL [UNIQUE] INDEXES
    +** DISABLE ALL UNIQUE INDEXES
    ++
    +disables all unique indexes on the table.
    +
    +** DISABLE ALL INDEXES
    ++
    +disables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* DISABLE INDEX _index-name_
    +
    +** DISABLE INDEX _normal-index-name_
    --- End diff --
    
    Similar remarks here


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584478
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -716,6 +777,222 @@ Alter TABLE PRODUCT
     ALTER COLUMN vend_id RENAME TO cstm_id;
     ```
     
    +* The following table _orders_ has two normal indexes 
    +(_index_orders1_ and _index_orders2_) and 
    +two unique indexes (_unique_index_orders1_ and _unique_index_orders2_).
    +
    ++
    +```
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    SALESREP ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one unique index (_unique_index_orders1_) and verify that all normal indexes (_index_orders1_ and _index_orders2_)
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX unique_index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one normal index (_index_orders1_) and verify that the rest normal index (_index_orders2_) 
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable all indexes and verify that all indexes (including normal indexes and unique indexes) are disabled.
    --- End diff --
    
    Thanks @DaveBirdsall, I've udpated :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184474271
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -716,6 +777,222 @@ Alter TABLE PRODUCT
     ALTER COLUMN vend_id RENAME TO cstm_id;
     ```
     
    +* The following table _orders_ has two normal indexes 
    --- End diff --
    
    Suggest "non-unique" instead of "normal"


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184474406
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -716,6 +777,222 @@ Alter TABLE PRODUCT
     ALTER COLUMN vend_id RENAME TO cstm_id;
     ```
     
    +* The following table _orders_ has two normal indexes 
    +(_index_orders1_ and _index_orders2_) and 
    +two unique indexes (_unique_index_orders1_ and _unique_index_orders2_).
    +
    ++
    +```
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    SALESREP ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one unique index (_unique_index_orders1_) and verify that all normal indexes (_index_orders1_ and _index_orders2_)
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX unique_index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable one normal index (_index_orders1_) and verify that the rest normal index (_index_orders2_) 
    +and the rest unique index (_unique_index_orders2_) are still enabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE INDEX index_orders1;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Disable all indexes and verify that all indexes (including normal indexes and unique indexes) are disabled.
    +
    ++
    +```
    +SQL>ALTER TABLE ORDERS DISABLE ALL INDEXES;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    ++
    +Enable all indexes on the table _orders_ and verify the result.
    +
    ++
    +```
    +SQL>ALTER TABLE orders ENABLE ALL INDEXES;
    +--- SQL operation complete.
    +
    +SQL>SHOWDDL orders;
    +CREATE TABLE TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDERNUM                         NUMERIC(6, 0) DEFAULT NULL NOT SERIALIZED
    +  , ORDER_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , DELIV_DATE                       DATE DEFAULT NULL NOT SERIALIZED
    +  , SALESREP                         NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  , CUSTNUM                          NUMERIC(4, 0) DEFAULT NULL NOT SERIALIZED
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    ORDER_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE INDEX INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    DELIV_DATE ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS1 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    SALESREP ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    +
    +CREATE UNIQUE INDEX UNIQUE_INDEX_ORDERS2 ON TRAFODION.SEABASE.ORDERS
    +  ( 
    +    CUSTNUM ASC
    +  )
    + ATTRIBUTES ALIGNED FORMAT 
    +;
    + 
    +-- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SEABASE.ORDERS TO DB__ROOT WITH GRANT OPTION;
    +
    +--- SQL operation complete.
    +```
    +
    --- End diff --
    
    The examples look great!


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584469
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* _index-name_
    +** _normal-index-name_
    ++
    +is equal to _index-name_, which is an SQL identifier that specifies the simple name for the index. You cannot qualify index-name with its schema name. 
    +Indexes have their own name space within a schema, 
    +so an index name might be the same as a table or constraint name. However, no two indexes in a schema can have the same name.
    +
    +** _unique-index-name_
    ++
    +is the name of the unique index.
    +
    +* ENABLE INDEX _normal-index-name_ 
    ++
    +enables a normal index on the table.
    +
    +* ENALBE INDEX _unique-index-name_
    ++
    +enables an unique index on the table.
    +
    +* DISABLE ALL [UNIQUE] INDEXES
    +** DISABLE ALL UNIQUE INDEXES
    ++
    +disables all unique indexes on the table.
    +
    +** DISABLE ALL INDEXES
    ++
    +disables all indexes (including normal indexes and unique indexes) on the table.
    +
    +* DISABLE INDEX _index-name_
    +
    +** DISABLE INDEX _normal-index-name_
    --- End diff --
    
    Thanks @DaveBirdsall, I've udpated :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184472501
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -442,6 +446,10 @@ ref-spec is:
     
     column-list is:
        column-name[, column-name]...
    +
    +index-name is:
    --- End diff --
    
    I don't think I would make this distinction in the syntax. There is no syntactic difference between what you're calling a "normal index" and a unique index. And all index names are in the same name space, whether or not they are unique. Consider deleting these lines.


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/trafodion/pull/1542


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by liuyu000 <gi...@git.apache.org>.
Github user liuyu000 commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184584475
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -716,6 +777,222 @@ Alter TABLE PRODUCT
     ALTER COLUMN vend_id RENAME TO cstm_id;
     ```
     
    +* The following table _orders_ has two normal indexes 
    --- End diff --
    
    Thanks @DaveBirdsall, I've udpated :)


---

[GitHub] trafodion pull request #1542: [TRAFODION-3044] Add Syntax and Examples of *E...

Posted by DaveBirdsall <gi...@git.apache.org>.
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1542#discussion_r184473071
  
    --- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
    @@ -576,6 +584,59 @@ the two columns or sets of columns must have the same characteristics (data type
     the foreign key in _table_ is the column being defined; with the foreign key clause, the foreign key is the column or set of columns specified in
     the foreign key clause. for information about _ref-spec_, see references _ref-spec_ not enforced.
     
    +<<<
    +* ENABLE ALL [UNIQUE] INDEXES
    +
    +** ENABLE ALL UNIQUE INDEXES
    ++
    +enables all unique indexes on the table.
    +
    +** ENABLE ALL INDEXES
    ++
    +enables all indexes (including normal indexes and unique indexes) on the table.
    --- End diff --
    
    I have not seen the term "normal indexes" anywhere else. When we feel the need to distinguish an index that is not unique, we usually just say, "non-unique indexes". Suggested wordsmith: "enables all indexes (including both non-unique and unique indexes) on the table".


---