Académique Documents
Professionnel Documents
Culture Documents
2 - access("PROCESS_NUM"=0)
--Let us see how the query performs with a full table scan on the table.
select /*+ full(a)*/ count(1) from PROCESS_EVENT a where PROCESS_NUM=0;
COUNT(1)
---------201988352
Elapsed: 00:07:16.14
Execution Plan
---------------------------------------------------------Plan hash value: 178217403
----------------------------------------------------------------------------------| Id | Operation
| Name
| Rows | Bytes | Cost (%CPU)| Time
|
----------------------------------------------------------------------------------| 0 | SELECT STATEMENT |
|
1 |
3 | 532K (2)| 01:46:
27 |
| 1 | SORT AGGREGATE
|
|
1 |
3 |
|
|
|* 2 | TABLE ACCESS FULL| PROCESS_EVENT | 102M| 292M| 532K (2)| 01:46:
27 |
----------------------------------------------------------------------------------Predicate Information (identified by operation id):
--------------------------------------------------2 - filter("PROCESS_NUM"=0)
--Using both the columns in the index.
select count(1) from PROCESS_EVENT where PROCESS_NUM=0 and PROCESS_EVENT_NUM=180
156510;
COUNT(1)
---------1
Execution Plan
---------------------------------------------------------Plan hash value: 222725074
-------------------------------------------------------------------------| Id | Operation
| Name | Rows | Bytes | Cost (%CPU)| Time
|
-------------------------------------------------------------------------| 0 | SELECT STATEMENT |
|
1 |
10 |
1 (0)| 00:00:01 |
| 1 | SORT AGGREGATE |
|
1 |
10 |
|
|
|* 2 | INDEX RANGE SCAN| IDX4 |
1 |
10 |
1 (0)| 00:00:01 |
-------------------------------------------------------------------------Predicate Information (identified by operation id):
1
1
1
1
1
1
23
1
1
1
1
1
1
1
1
1
1
1
3
13
138
2
10
1
1
1
1
1
1
2
1551
3
1
1
1
1
1
1
1
1
82
143
1
1
1
4
16116
100
4
53
1
1
6
403
8838
3
2
1
1
1
1
1
1
1
1
1
67
1
1
1
1
1
1
1
1
1
1
1
3
31
396
6
13
1
1
1
1
1
1
7
4499
8
1
1
1
1
1
1
1
1
216
434
1
1
1
11
20507
136
4
88
1
1
10
1121
25734
14
5
1
1
1
1
1
1
2
1
3
1338
1261
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
5
1
1
1
1
1
15
1
1
1
1
6
1
1
3
4
4
3
1
1
2
6
2
29
3
1
3
1
1
3
1
3
4
1
9
3778
3637
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10
1
1
1
1
2
46
1
1
1
1
6
1
1
3
11
6
3
1
1
6
6
7
76
3
1
3
1
1
1
1
1
1
1
6
718
29
1
34
1
1
697
2540
24
13
1
2
2
1
1
1
4
4
2
1
1
8
1
1
1
149
1
149
16
3
2
2
1
8
14
1
1
4609
1
1
10
16
76
1
7
2
22
4107
1
190
1
884
1
19
1
1
1
1
1
6
2030
77
1
34
1
3
1802
3824
42
25
1
6
25
1
1
1
5
10
6
1
1
28
1
1
1
285
1
386
51
4
2
8
1
8
43
1
1
7015
1
1
18
26
95
1
17
14
67
7292
2
332
1
1050
1
21
2
54
2
1
1
1
1
1
2
1
10
39
1
1
1
4
23
37
63
6871
19
3
1
1
52
16
3444
313
4379
4732
1069
24
44
1343488
2
2
70
44
1
1
1
27
26
1
1
2
29
3966
2046
3966
1770
27
175
191
7
184
46
15
3
88
2
150
2
1
1
1
1
1
3
3
17
57
1
1
1
4
22
39
62
20158
19
3
1
1
52
16
3443
313
4379
4731
1070
27
47
1368064
2
2
69
43
1
1
1
30
29
1
1
2
30
3968
2046
3968
1771
27
181
199
7
192
47
15
3
89
STAT..enqueue requests
STAT..enqueue waits
STAT..execute count
STAT..file io wait time
STAT..free buffer requested
STAT..immediate (CR) block cleanout applications
STAT..immediate (CURRENT) block cleanout applications
STAT..index fetch by key
STAT..index scans kdiixs1
STAT..lob reads
STAT..lob writes
STAT..lob writes unaligned
STAT..messages sent
STAT..min active SCN optimization applied on CR
STAT..no work - consistent read gets
STAT..non-idle wait count
STAT..non-idle wait time
STAT..opened cursors cumulative
STAT..opened cursors current
STAT..parse count (hard)
STAT..parse count (total)
STAT..parse time cpu
STAT..parse time elapsed
STAT..physical read IO requests
STAT..physical read bytes
STAT..physical read total IO requests
STAT..physical read total bytes
STAT..physical reads
STAT..physical reads cache
STAT..physical reads cache prefetch
STAT..physical write IO requests
STAT..physical write bytes
STAT..physical write total IO requests
STAT..physical write total bytes
STAT..physical writes
STAT..physical writes direct
STAT..physical writes non checkpoint
STAT..pinned cursors current
STAT..recursive calls
STAT..recursive cpu usage
STAT..redo entries
STAT..redo size
STAT..redo size for direct writes
STAT..redo synch time (usec)
STAT..redo synch writes
STAT..rows fetched via callback
STAT..session cursor cache count
STAT..session cursor cache hits
STAT..session logical reads
STAT..session pga memory
STAT..session pga memory max
STAT..session uga memory
STAT..session uga memory max
STAT..shared hash latch upgrades - no wait
STAT..sorts (memory)
STAT..sorts (rows)
STAT..sql area purged
STAT..switch current to new buffer
STAT..table fetch by rowid
STAT..table fetch continued row
89
1
528
97689
177
2
4
583
474
47
2
2
8
1
1807
170
11
381
2
41
305
6
6
142
1286144
142
1286144
157
157
15
1
57344
1
57344
7
7
7
2
2922
23
93
22596
96
2659
2
510
1
302
4157
4849664
4915200
851656
1025240
40
175
457
1
5
1328
33
90
1
528
102099
181
2
4
583
474
47
2
2
8
1
1806
173
11
381
2
41
305
7
9
145
1310720
145
1310720
160
160
15
1
57344
1
57344
7
7
7
2
2922
22
96
23344
96
2618
2
510
1
302
4167
4784128
4849664
851656
1025240
40
175
457
1
5
1328
33
85
14928
16
4194304
7332
10
27
3
63
187
85
14928
16
4194304
7572
11
27
3
63
139
end;
end loop;
exception
when others then
dbms_output.put_line(c1.table_name||' '||sqlerrm);
end;
end loop;
end;
/
http://asktom.oracle.com/pls/asktom/ASKTOM.download_file?p_file=6551378329289980
701
http://mattfleming.com/node/192
http://richardfoote.wordpress.com/2008/05/12/index-scan-or-full-table-scan-the-m
agic-number-magic-dance/