CREATE INDEX

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

Sintassi

CREATE [OR REPLACE] [ONLINE|OFFLINE] [UNIQUE|FULLTEXT|SPATIAL] INDEX
  [IF NOT EXISTS] nome_indice
    [tipo_indice]
    ON nome_tabella (nome_colonna_indicizzata,...)
    [opzione_indice] ...

nome_colonna_indicizzata:
    nome_colonna [(lunghezza)] [ASC | DESC]

tipo_indice:
    USING {BTREE | HASH | RTREE}

opzione_indice:
    KEY_BLOCK_SIZE [=] valore
  | index_type
  | WITH PARSER nome_parser
  | COMMENT 'string'

Spiegazione

CREATE INDEX è mappata all'istruzione ALTER TABLE e serve a creare un indice. Si veda ALTER TABLE. CREATE INDEX non può essere usata per creare una chiave primaria; a questo scopo, si usi ALTER TABLE.

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.