set echo on
set timing on
spool 2_createIndexes.log
conn medline/medline

drop index citation_bix_ix force;
drop index citation_bix_text_ix;

-- Create XML index on the binary XML table
create index citation_bix_ix on medline_tab(citation) indextype is xdb.xmlindex
             parameters ('PATH TABLE      citation_bix_path_table
                          PATH ID INDEX   citation_bix_path_id_ix
                          ORDER KEY INDEX citation_bix_order_key_ix
                          VALUE INDEX     citation_bix_value_ix')
/

-- Create a secondary text index on the VALUE column of the path table
CREATE INDEX citation_bix_text_ix ON citation_bix_path_table (VALUE) INDEXTYPE IS CTXSYS.CONTEXT
       parameters ('transactional')
/

call dbms_stats.gather_index_stats(USER,'citation_bix_ix')
/
call dbms_stats.gather_index_stats(USER,'citation_bix_text_ix')
/
commit
/
spool off

