Interpreting Oracle's day05

interpreting oracle day05 day

– Create a normal index
create index index_owners_name on t_owners(name);

select * from t_owners where name=‘ Zhang Zhe ’

– Performance testing Create a table ,
CREATE TABLE T_INDEXTEST ( ID NUMBER, NAME VARCHAR2(30) );

– Insert... Into the table 100 Ten thousand records
begin
for x in 1…1000000
loop
insert into T_INDEXTEST values(x,‘AA’||x );
end loop;
commit;
end;

– Create index
CREATE INDEX INDEX_TEST ON T_INDEXTEST(NAME);

SELECT * FROM T_INDEXTEST WHERE ID=765432;

SELECT ROWID,t.* FROM T_INDEXTEST t WHERE NAME=‘AA765432’

select * from t_indextest where rowid=‘AAAM3GAAGAAAAqHAA6’;

– Create unique index
create unique index index_owners_meter on t_owners(watermeter);

select * from t_owners where addressid=1 and housenumber=‘1-3’;

– Create composite index
create index index_owners_ah on t_owners(addressid,housenumber);

copyright:author[qq_ forty-five million eight hundred and forty-nine thousand tw],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130504208748.html