Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see the indexes on a table in mysql workbench?

I'm using mysql workbench and under the object information section the column names and types are listed. It it shows what column has the primary key (if there is one.)

However it doesn't list the unique indexes/keys.

Is there any way I can view which columns have unique indexes/keys on them?

like image 882
user784637 Avatar asked Mar 23 '12 15:03

user784637


People also ask

How do I see indexes in MySQL workbench?

Enter a name for the index and select the index type from the list. Select the column or columns that you wish to index by checking the column name in the Index Columns list. You can remove a column from the index by removing the check mark from the appropriate column.

How do I view the contents of a table in MySQL workbench?

To open, right-click a table in the object browser of the Navigator pane and choose Table Inspector from the context menu. The Table Inspector shows information related to the table.

How do I get a list of indexes in a database?

You can use the sp_helpindex to view all the indexes of one table. And for all the indexes, you can traverse sys. objects to get all the indexes for each table.

How do I know if my table has an index?

Answers. In Management studio, go to the table you can see + symbol for the table click on that you can see Columns,Keys,Constraints,Triggers,Indexes,Statistics. If you have Indexes for the table after you click + symbol against Indexes you get the Index name with the column for which you declared index.


1 Answers

I don't think there is a special interface for that... you can still use the direct query:

show indexes from <table>

That's wrong, it exists! Check Hexparrot answer.

To see it, right click on you table -> alter table, and you'll find the "indexes" tables

like image 148
haltabush Avatar answered Oct 31 '22 17:10

haltabush