Solo
Solo

Reputation: 6957

Duplicate indexes in MySQL

I chose table, then went to "Structure" tab and accidentaly clicked "Index".

Now, when I go inside the table, column strucure is still the same (4 columns) but "Sort by" dropdown shows duplicated value which I clicked "Index" on.

Example:

                --------------------------
  Sort by key:  |     DROPDOWN        V  |
                |________________________|
                |     PRIMARY (desc)     |
                |     PRIMARY (incr)     |
                |     post_id (desc)     |
                |     post_id (incr)     |
                |     post_id_2 (desc)   |      <-----  Problem
                |     post_id_2 (incr)   |      <-----  Problem
                |           etc          |
                --------------------------

How to undo this or delete dublicates? I also appriciate if you told me what I did.

I did search online but Im not exactly sure what to search for, I also tried to find a way to undo this myself but Im afraid that pressing anything else will make it even worse before exactly knowing what these do.

Upvotes: 1

Views: 155

Answers (1)

Marc Delisle
Marc Delisle

Reputation: 9012

On this table, click on "Structure". On this page you should see "+ Indexes". Click on that to reveal the list of indexes. Find the one named "post_id_2" and click on "Drop" next to it.

Upvotes: 1

Related Questions