Bug #55497 double indexing in diagram
Submitted: 23 Jul 2010 7:57 Modified: 11 May 2018 10:26
Reporter: Susanne Ebrecht Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.25 SE OS:Linux (Ubuntu)
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D4 (Minor)

[23 Jul 2010 7:57] Susanne Ebrecht
Description:
Index names 'primary' already is an unique index.

When you create another unique index on that column Workbench won't recognise it.
(Also not during validation check of Workbench SE).

Same vise versa ... when there already is a unique key on the column and you set PK then diagram is generating a second unique index named primary.

At the end you have two unique indexes on same table column.

This won't just confuse the optimizer ... this also will need tons of extra space.

I will add two videos here ... the first shows what I mean in diagram and the second shows what happens on forward engineering.

How to repeat:
Watch the videos

Suggested fix:
Before creating primary key check if column already has unique index.
Before creating unique key check if column already is set as primary key.
[23 Jul 2010 7:58] Susanne Ebrecht
Video to show what I mean in diagram

Attachment: pk_unique_index_test_diagram.ogv (video/ogg, text), 285.00 KiB.

[23 Jul 2010 7:59] Susanne Ebrecht
Video to show what I meant when talking about forward engineering

Attachment: pk_unique_index_test_forward_eng.ogv (video/ogg, text), 475.34 KiB.

[11 May 2018 10:26] Marcin Szalowicz
Posted by developer:
 
This is not a bug. It's perfectly valid and you can create such a table that will have both primary and unique key.