Driver table:
Take the driver table which returns the less number of rows for predicate with literal valae. For example,
Consider the statement below:
SELECT SUM(BIP.VALUE) value
FROM BSKT_ITEM_CALC_PRICING BIP,BSKT_PRICING_ELEMENT BP
WHERE BIP.BASKET_ITEM_ID IN (:”SYS_B_0″)
AND BIP.PRICING_ELEMENT_ID = BP.PRICING_ELEMENT_ID
AND BP.PRICING_TYPE_CODE = :1;
Here
SQL> select BASKET_ITEM_ID, count(1) from BSKT_ITEM_CALC_PRICING group by BASKET_ITEM_ID;
BASKET_ITEM_ID COUNT(1)
———————————— ———
0cb3d2ac-1752-11db-b16d-e7b30c1e0ad1 3
0cb4816e-17e4-11db-b16d-e7b30c1e0ad1 2
0cb4e921-17df-11db-b177-87592b92a6f6 1
0cb614dc-17f4-11db-b16d-e7b30c1e0ad1 3
0cb7df1e-17f3-11db-9334-ab56ed57951d 1
and
15:00:41 CS@WEBP18F:-> select PRICING_TYPE_CODE, count(1) from BSKT_PRICING_ELEMENT group by PRICING_TYPE_CODE;
PRICING_TYPE_CODE COUNT(1)
—————– ———
1 139283
2 45646
3 58404
4 104810
7 145377
11 98004
15 878
So table BSKT_ITEM_CALC_PRICING is candidate for driver table.