/*
 *
 */
prompt
prompt 'create table eoda.t'
declare row_count number(5);
begin
	select count(1) into row_count from user_tables where table_name = upper('t');
	if row_count = 1 then
		execute immediate 'drop table eoda.t';
	end if;
	execute immediate '
		create table eoda.t(x int)
	';
end;
/

prompt
prompt 'insert data into eoda.t'
	insert into eoda.t select round(dbms_random.value(1,10000)) from dual connect by level <= 10000;
/

prompt
prompt 'create index edoa.ti'
begin
	dbms_stats.gather_table_stats( user, 'T' );
	execute immediate 'create index eoda.ti on eoda.t(x) invisible';
end;
/

select * from eoda.t where x = 5;
alter session set optimizer_use_invisible_indexes=true;
select * from eoda.t where x = 5;
alter session set optimizer_use_invisible_indexes=false;
