記憶-oracle-執行計劃查看

1 數據創建 

create table test_index(id int primary key,v int )
create index test_index_v_desc on test_index(v)

2 數據輸入

declare 
a int:=0;
begin
  while (a < 100) loop
    insert into test_index(id,v) values(a,a);
    a:=a+1;
    end loop;
end;

3 執行計劃查看

3.1.計劃:全表查詢

explain plan for
select * from test_index 
select * from table(dbms_xplan.display)

 3.2.計劃:使用索引

explain plan for
select * from test_index where v=100

 

select * from table(dbms_xplan.display)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章