如果我无法更改数据库规则和结构,请帮助加快查询以选择所有在当前表上引用的表名和列名
谢谢
SELECT
DISTINCT AC.table_name, ACC.column_name
FROM
all_constraints AC
INNER JOIN all_cons_columns ACC
ON ACC.table_name = AC.table_name
AND
ACC.constraint_name = AC.constraint_name
WHERE
AC.r_constraint_name IN (
SELECT AC.constraint_name
FROM all_constraints AC
WHERE
table_name='CURRENT_TABLE'
AND
owner='SOME_DATABASE_NAME'
)