Bug #66488 Do not generate index for FK in model
Submitted: 21 Aug 2012 20:35 Modified: 6 Nov 2012 19:50
Reporter: Luke Stevens Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[21 Aug 2012 20:35] Luke Stevens
Description:
Currently, when a foreign key is created in a model, an associated index is also created. This index is treated specially; for example, it cannot be deleted (at least not directly). 

This request is simply to stop doing that. 

It's hard to see any benefit. If no suitable index is specified, one will be implicitly created when the generated script is run. If the user would like to create an index explicitly, they could always do so. More importantly, if the user needs to re-use an existing index (e.g. a primary key) or create a suitable new index different from the default (e.g., multiple columns), the current behavior just gets in the way by forcing creation of a superfluous index. 

This request is similar to Bug #53277 (see discussion there), but larger and simpler. Instead of suppressing the automatically-generated foreign key index in some cases, simply remove the behavior altogether. 

How to repeat:
In a model, create a foreign key. Observe that an unnecessary and often undesired index is also created and cannot be deleted. 

Suggested fix:
Don't generate indexes for foreign keys, and allow users to delete existing indexes. 

And BTW, stop complaining when an index name matches a FK name (see Bug #60705).
[16 Sep 2012 2:30] MySQL Verification Team
Please try version 5.2.43 . Thanks.
[27 Sep 2012 9:37] pierre b
Still have the same problem on Ubuntu 12.04 64bits with version 5.2.43...
[3 Oct 2012 17:08] Armando Lopez Valencia
Thanks for the report Luke.
Entered to the system as feature request.

Verified in:
Ubuntu12.04x64
WB 5.2.44
Thanks.
[6 Nov 2012 19:50] Alfredo Kojima
duplicate of bug #53277