-
Notifications
You must be signed in to change notification settings - Fork 849
/
Copy pathj5.sql
33 lines (25 loc) · 866 Bytes
/
j5.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--
-- Again forcing the (bad) nested loop join
-- Notice how the cost is more that j4.sql
-- because we are scanning a bigger table: TABLE_100000
--
-- Notice also that it is very clear that the "Cost" column
-- is PER START and not a total. There are some slight rounding errors.
--
select /*+ gather_plan_statistics use_nl(a b) */ sum(a.id), sum(b.id)
from table_100 a
join table_100000 b on (a.id = b.fkcol)
where a.fcol <= 10;
@@sta
pause Press <cr> to continue
select /*+ gather_plan_statistics use_nl(a b) */ sum(a.id), sum(b.id)
from table_100 a
join table_100000 b on (a.id = b.fkcol)
where a.fcol <= 20;
@@sta
pause Press <cr> to continue
select /*+ gather_plan_statistics use_nl(a b) */ sum(a.id), sum(b.id)
from table_100 a
join table_100000 b on (a.id = b.fkcol)
where a.fcol <= 30;
@@sta