JC2102
JC2102

Reputation: 55

How to create/declare secondary index in MySQL?

What is the sintaxis that I can use to create a secondary index in a MySQL table on any of its columns?

Upvotes: 1

Views: 1066

Answers (1)

matigo
matigo

Reputation: 1461

For non-clustered indexes, will want to use something like:

CREATE INDEX `idx_{name}` ON `{TableName}` (`{column}`, `{column}`);

Be sure to change the items in squiggly brackets to something that is better suited to your goals.

Upvotes: 2

Related Questions