我需要在Oracle的外键上创建索引吗? [英] Do I need to create indexes on foreign keys on Oracle?

查看:249
本文介绍了我需要在Oracle的外键上创建索引吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表A和一个表B. AB的主键B_ID上具有指向B的外键.

I have a table A and a table B. A has a foreign key to B on B's primary key, B_ID.

由于某种原因(我知道有正当的理由),当我将这两个表联接到键上时,它没有使用索引.

For some reason (I know there are legitimate reasons) it is not using an index when I join these two tables on the key.

我是否需要在A.B_ID上单独创建索引,还是应该使用外键提供索引?

Do I need to separately create an index on A.B_ID or should the existence of a foreign key provide that?

推荐答案

仅外键约束不能提供Oracle上的索引-必须(并且应该)创建一个.

The foreign key constraint alone does not provide the index on Oracle - one must (and should) be created.

这篇关于我需要在Oracle的外键上创建索引吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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