Dec 15, 2010

The MySQL SHOW INDEX command

For a long time I couldn't remember how to show the indexes for a database table with MySQL, but I think it's finally sunk in. Just use the MySQL SHOW INDEX command, like this:

show index from node;

That example can be read as, "Show the indexes from the database table named node". It assumes that you have already selected a database table, so really, a full sequence of commands to show a MySQL database table index looks like this:

Syntax variations

As you may have noticed from that last example, you don't have to type show index; either of the following three commands will give you the same results:

show index from node;
show indexes from node;
show keys from node;

No comments:

Post a Comment