MySQL Workbench 是否会自动为外键创建索引? [英] Does MySQL Workbench automatically create indexes for foreign keys?

查看:83
本文介绍了MySQL Workbench 是否会自动为外键创建索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 MySQL Workbench 中创建外键时,索引"选项卡上会出现一个与我刚刚创建的外键完全相同的新条目.

When I create a foreign key in MySQL workbench, a new entry appears on the "Indexes" tab with the exact same same as the foreign key that I just created.

这实际上是外键,出于某种原因显示在索引"选项卡上吗?或者 MySQL Workbench 是否试图为我提供帮助并为我创建一个索引,知道我可能会针对该列进行选择,并为其(令人困惑地)赋予与外键相同的名称?

Is this actually the foreign key, showing up on the "Indexes" tab for some reason? Or does MySQL Workbench try to be helpful and create an index for me, knowing that I'm likely to be selecting against that column, and give it (confusingly) the same name as the foreign key?

推荐答案

这是 MySQL,而不是 Workbench.
是的,在创建外键约束时创建索引很有帮助.

It's MySQL doing that, not workbench.
And yes, it is being helpful to create an index when you create a foreign key constraint.

这篇关于MySQL Workbench 是否会自动为外键创建索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆