Mysql Index

Create Index in mysql
A database index is a data structure that improves the speed of operations in a table. 
Indexes can be created using one or more columns.
The SPATIAL index supports spatial column and is available on MyISAM storage engine.

The FULLTEXT index is supported only by MyISAM storage engine.
UNIQUE index, MySQL creates a constraint that all values in the index must be unique.
syntax:

CREATE UNIQUE INDEX index_name
ON table_name ( column1, column2,...);

Example:

CREATE UNIQUE INDEX answerinfo2
ON answerinfo (Forum_id);

Mysql drop Index

Example:

ALTER TABLE answerinfo DROP INDEX answerinfo2;
OR
DROP INDEX answerinfo2 ON answerinfo

Post a Comment

0 Comments