Hi all,
I was working on a SQL query where a history table is joined with a small table to get some information. There is an index on the history table column but the explain plan tells that there is a full table scan on both the tables. The query and the explain plan is below
select * from history_table ht, small_table st
where ht.columnA > st.columnB
and sysdate between st.datetime1 and st.datetime2;
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 748 M 569565
MERGE JOIN 748 M 152G 569565
SORT JOIN 965 51 K 97
TABLE ACCESS FULL USER1.SMALL_TAB LE 965 51 K 21
SORT JOIN 15 M 2G 569468
TABLE ACCESS FULL USER1.HISTORY_T ABLE 15 M 2G 137725
I was working on a SQL query where a history table is joined with a small table to get some information. There is an index on the history table column but the explain plan tells that there is a full table scan on both the tables. The query and the explain plan is below
select * from history_table ht, small_table st
where ht.columnA > st.columnB
and sysdate between st.datetime1 and st.datetime2;
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 748 M 569565
MERGE JOIN 748 M 152G 569565
SORT JOIN 965 51 K 97
TABLE ACCESS FULL USER1.SMALL_TAB LE 965 51 K 21
SORT JOIN 15 M 2G 569468
TABLE ACCESS FULL USER1.HISTORY_T ABLE 15 M 2G 137725
Comment