CREATE materialized VIEW RM.ALL_CONS_COLUMNS AS SELECT * from sys.all_cons_columns WHERE OWNER = (select user from dual); CREATE INDEX RM.IX$ALL_CONS_COLUMNS ON RM.ALL_CONS_COLUMNS(TABLE_NAME, OWNER); execute dbms_stats.gather_table_stats(ownname => 'RM', tabname => 'ALL_CONS_COLUMNS', estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO'); CREATE materialized VIEW RM.ALL_SYNONYMS AS SELECT * FROM sys.all_synonyms WHERE OWNER = (select user from dual); CREATE INDEX RM.IX$ALL_SYNONYMS ON RM.ALL_SYNONYMS(OWNER, SYNONYM_NAME, TABLE_OWNER, TABLE_NAME); execute dbms_stats.gather_table_stats(ownname => 'RM', tabname => 'ALL_SYNONYMS', estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO'); CREATE materialized VIEW RM.ALL_IND_COLUMNS AS SELECT * FROM SYS.ALL_IND_COLUMNS WHERE TABLE_OWNER = (select user from dual); create index RM.IX$ALL_IND_COLUMND on RM.ALL_IND_COLUMNS(TABLE_NAME, TABLE_OWNER, INDEX_NAME); execute dbms_stats.gather_table_stats(ownname => 'RM', tabname => 'ALL_IND_COLUMNS', estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO'); CREATE materialized VIEW RM.ALL_INDEXES AS SELECT * FROM sys.all_indexes WHERE OWNER = (select user from dual); create index RM.IX$ALL_INDEXES on RM.ALL_INDEXES(TABLE_NAME, OWNER); execute dbms_stats.gather_table_stats(ownname => 'RM', tabname => 'ALL_INDEXES', estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR ALL COLUMNS SIZE AUTO');