ADD INDEX 절

설명

ADD INDEX 절은 특정 컬럼에 대해 인덱스 속성을 추가로 정의할 수 있다.

구문

ALTER [ TABLE | CLASS ] table_name ADD { KEY | INDEX } [index_name] (<index_col_name>)

 

<index_col_name> ::=

column_name [(length)] [ ASC | DESC ]

예제

ALTER TABLE a_tbl ADD INDEX (age ASC), ADD INDEX(phone DESC);

;schema a_tbl

 

=== <Help: Schema of a Class> ===

 

 <Class Name>

 

     a_tbl

 

<Attributes>

 

     name                 CHARACTER VARYING(1073741823) DEFAULT ''

     phone                CHARACTER VARYING(13) DEFAULT '111-1111'

     age                  INTEGER

     id                   INTEGER AUTO_INCREMENT  NOT NULL

 

 <Constraints>

 

     UNIQUE u_a_tbl_id ON a_tbl (id)

     INDEX i_a_tbl_age ON a_tbl (age)

     INDEX i_a_tbl_phone_d ON a_tbl (phone DESC)

 

Current transaction has been committed.