Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the default oracle index global or local

When I create an index on an oracle table and just specify column name and table name (basically a default index), does it create a global index or a local partitioned index (i.e the index is partitioned according to the table partitions)?

like image 988
Victor Avatar asked Jan 12 '23 13:01

Victor


1 Answers

create table T_Test
(
  pk_test number(10),
  val     number(10)
)
partition by hash (val)
(
  partition p1,
  partition p2,
  partition p3

);

insert into t_test values (1,3);
insert into t_test values (2,2);
insert into t_test values (3,5);
insert into t_test values (5,6);
insert into t_test values (6,7);
insert into t_test values (7,4);

commit;

create index ix_test on t_test(val);

select partitioned from user_indexes where index_name = 'IX_TEST';
>> NO

So by default, an index will be created as a global index.

like image 169
Thomas Tschernich Avatar answered Jan 16 '23 19:01

Thomas Tschernich