I am maintaining an application creating an Oracle DB via JDBC. Starting from today this query:
SELECT NULL AS
I found this way to cheat.. run this as the user you connect with jdbc before you reverse engineer a schema..
CREATE TABLE all_constraints AS
SELECT owner,
constraint_name,
constraint_type,
table_name,
r_owner,
r_constraint_name,
delete_rule,
status,
deferrable,
deferred,
validated,
generated,
bad,
rely,
last_change,
index_owner,
index_name,
invalid,
view_related
FROM all_constraints;
CREATE TABLE all_cons_columns AS
SELECT *
FROM all_cons_columns;
CREATE INDEX ac1
ON all_constraints (owner, constraint_name, table_name);
CREATE INDEX acc1
ON all_cons_columns (owner, constraint_name, table_name);
Then the query in question really screams.. the downside is you have to refresh it from time to time.. maybe make it a materialized view?