Query to increaese sort_area_size
Please give me the query to increase sort_area_size
Please give me the query to increase sort_area_size What do you mean by query. Do you want to increase this parameter or something else.
If you want to change this parameter then it can not be modifiable. You need to change in init.ora or spfile and need to restart db.Check the values with
SQL> show parameter sort_area_size
NAME TYPE VALUE
sort_area_size integer 524288
Cheers
Similar Messages
-
SORT_AREA_SIZE and blob update in plsql?
Can someone please answer the below questions I have.
- The tables t1 and t2 both have around 1.5 million rows.
- Table t1 has PK defined on col1 and col2
- Table t2 has unique index defined on col1 and col2
1) Does the below query use the SORT_AREA_SIZE while running the query?
2) The below query when explain planned uses NESTED LOOP and FULL TABLE SCAN on table2. I am currently running the below in a cursor for loop to update a blob column on table1. It is taking long time? What are the alternative ways I can tune this query or tune PLSQL to update blob columns in table t1.
<pre>
SELECT rownum as rec, t1.col1, t1.col2, t2.col1, t2.col2,
replace(replace(t2.col1, 'str1','strn'), 'str2','strn')
FROM table1 t1, table2 t2
where t1.col1 = t2.col1
and t1.col2 = t2.col2
</pre>
<pre>
<b>EXPLAIN PLAN OUTPUT</b>
OPERATION OPTIONS OBJECT_NAME POSITION
SELECT STATEMENT 408
COUNT 1
NESTED LOOPS 1
TABLE ACCESS FULL TABLE2 1
INDEX UNIQUE SCAN SYS_C000001 2
</pre>It's a little hard to read your post. If you use any HTML tags then all bbcode tags are ignored - perhaps you included some HTML tags when you posted?
Anyway, the AREASIZE settings depend on your Oracle version. From 9i onwards they are not used if workarea_size_policy is set to AUTO, in which case a percentage of pga_aggregate_target is used instead. -
SORT_AREA_SIZE Question
Can someone please answer the below questions I have.
- The tables t1 and t2 both have around 1.5 million rows.
- Table t1 has PK defined on col1 and col2
- Table t2 has unique index defined on col1 and col2
1) Does the below query use the SORT_AREA_SIZE while running the query?
2) The below query when explain planned uses NESTED LOOP and FULL TABLE SCAN on table2. I am currently running the below in a cursor for loop to update a blob column on table1. It is taking long time? What are the alternative ways I can tune this query or tune PLSQL to update blob columns in table t1.
SELECT rownum as rec, t1.col1, t1.col2, t2.col1, t2.col2,
replace(replace(t2.col1, 'str1','strn'), 'str2','strn')
FROM table1 t1, table2 t2
where t1.col1 = t2.col1 and t1.col2 = t2.col2What version of Oracle are you on?
How many rows does the query return?
Nested loops generally perform poorly when the amount of rows returned is very large.
How long does the query take when you run it in sqlplus?
Are statistics on the table current?
SORT_AREA_SIZE and HASH_AREA_SIZE control the maximum amount of memory those operations could use in Oracle 8i and earlier. Since your query is using NESTED LOOPS then I would guess that increasing your SORT_AREA_SIZE parameter will not speed up the query. -
How do i know if my query using SORT_AREA_SIZE or temporary tablespace ?
Good Morning Everyone !
My DB version is 10.2.0.1
I have large table exactly 3 million records.
SQL> select count(*) from tab1;
COUNT(*)
300000
SQL> select * from tab1 order by no DESC;
sorting ... in process
300000 rows selected.
in Terminal 2 : I tried to find sorting details - ( No rows selected - why ? )
SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage ;
no rows selected
SQL> /
no rows selected
When i google i have seen this ;
If Oracle cannot do the sort in memory (SORT_AREA_SIZE initialisation parameter), space will be allocated in a temporary tablespace for doing the sort operation.
REF_LINK : TEMPORARY Tablespaces and TEMPFILES | Oracle FAQ
MY DOUBT QUESTION : How do i know if my query using SORT_AREA_SIZE or temporary tablespace ?
Thanks in advance.@ JohnWatson
I have seen some articles from ORA - FAQ. Good.
SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage;
USERNAME USER TABLESPACE SQL_ID
SCOTT SYS TEMP fh9vqgyd6m0d1
PGA management means that sorting only 300000 rows may well occur in memory
Is this (3 million rows) - standard value for 10g version ?
Thanks JohnWatson -
Error ORA-01652 while running select query
A select query returning millions of records is returning the following error.
SQL Error [
ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
We requested DBA to increased the TEMP tablespace. He increased it to 20GB and also, changed to Autoextent.
When we executed the query again, we got the same error ?
What could be the reason of this issue and how it can be resolved ?All sort operations that don't fit into the SORT_AREA_SIZE will go to the temp tablespace (they can be seen as direct writes in the trace file).
It can easy be the case, that your temp tablespace needs to be many GB in size [we have a table with millions of rows and for the loading/merging our temp is 80GB in size].
May be you can change your process of loading i.e. with this select you fill a intermediate table (with CTAS) and do your processing there or even try to do the processing in SQL while building the table. You could also try to do the processing with a cursor and BULK COLLECT LIMIT 100 and then inserting into the target table with the FORALL statement. -
Response Time of a query in 2 different enviroment
Hi guys Luca speaking, sorry for the bad written english
the questions is:
The same query on the same table, for definition, number of rows, defined on the same kind of tablespace, the tables are analized
*) I have a query in Benchmark with good results in execution time, the execution plan is really good
*) in Production the execution plan is not so good, the response time isn't comparable (hours vs seconds)
#### The Execution Plan are different ####
#### The stats are the same ####
this a table storico.FLUSSO_ASTCM_INC A with this stats in benchmark
chk Owner Name Partition Subpartition Tablespace NumRows Blocks EmptyBlocks AvgSpace ChainCnt AvgRowLen AvgSpaceFLBlocks NumFLBlocks UserStats GlobalStats LastAnalyzed SampleSize Monitoring Status
True STORICO FLUSSO_ASTCM_INC TBS_DATA 2861719 32025 0 0 0 74 NO YES 10/01/2006 15.53.43 2861719 NO Normal, Successful Completion: 10/01/2006 16.26.05
in Production the stas are the same
the other one is an external_table
the only differences that I noticed at the moment is about the tablespace used to defined the table on:
Production
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K
Benchmark
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
I'm studing on at the moment
What I have to check to obtain the same execution plan (without change the query)
This is the query:
SELECT
'test query',
sysdate,
storico.tc_scarti_seq.NEXTVAL,
NULL, --ROW_ID
-- A.AZIONE,
'I',
A.CODE_PREF_TCN,
A.CODE_NUM_TCN,
'ADSL non presente su CRM' ,
-- a.AZIONE
'I'
|| ';' || a.CODE_PREF_TCN
|| ';' || a.CODE_NUM_TCN
|| ';' || a.DATA_ATVZ_CMM
|| ';' || a.CODE_PREF_DSR
|| ';' || a.CODE_NUM_TFN
|| ';' || a.DATA_CSSZ_CMM
|| ';' || a.TIPO_EVENTO
|| ';' || a.INVARIANTE_FONIA
|| ';' || a.CODE_TIPO_ADSL
|| ';' || a.TIPO_RICHIESTA_ATTIVAZIONE
|| ';' || a.TIPO_RICHIESTA_CESSAZIONE
|| ';' || a.ROW_ID_ATTIVAZIONE
|| ';' || a.ROW_ID_CESSAZIONE
FROM storico.FLUSSO_ASTCM_INC A
WHERE NOT EXISTS (SELECT 1 FROM storico.EXT_CRM_X_ADSL B
WHERE A.CODE_PREF_DSR = B.CODE_PREF_DSR
AND A.CODE_NUM_TFN = B.CODE_NUM_TFN
AND A.INVARIANTE_FONIA = B.INVARIANTE_FONIA
AND B.NOME_SERVIZIO NOT IN ('ADSL SMART AGGREGATORE','ADSL SMART TWIN','ALICE IMPRESA TWIN',
'SERVIZIO ADSL PER VIDEOLOTTERY','WI - FI') )
Esito di set autotrace traceonly explain ESERCIZIO
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=144985 Card=143086 B
1 0 SEQUENCE OF 'TC_SCARTI_SEQ'
2 1 FILTER
3 2 TABLE ACCESS (FULL) OF 'FLUSSO_ASTCM_INC' (Cost=1899 C
4 2 EXTERNAL TABLE ACCESS* (FULL) OF 'EXT_CRM_X_ADSL' (Cos :Q370300
4 PARALLEL_TO_SERIAL SELECT /*+ NO_EXPAND FULL(A1) */ A1."CODE_PR
Esito di set autotrace traceonly explain BENCHMARK
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3084 Card=2861719 By
tes=291895338)
1 0 SEQUENCE OF 'TC_SCARTI_SEQ'
2 1 HASH JOIN* (ANTI) (Cost=3084 Card=2861719 Bytes=29189533 :Q810002
8)
3 2 TABLE ACCESS* (FULL) OF 'FLUSSO_ASTCM_INC' (Cost=3082 :Q810000
Card=2861719 Bytes=183150016)
4 2 EXTERNAL TABLE ACCESS* (FULL) OF 'EXT_CRM_X_ADSL' (Cos :Q810001
t=2 Card=1 Bytes=38)
2 PARALLEL_TO_SERIAL SELECT /*+ ORDERED NO_EXPAND USE_HASH(A2) US
E_ANTI(A2) */ A1.C0,A1.C1,A1.C2,A1.C
3 PARALLEL_FROM_SERIAL
4 PARALLEL_TO_PARALLEL SELECT /*+ NO_EXPAND FULL(A1) */ A1."CODE_PR
EF_DSR" C0,A1."CODE_NUM_TFN" C1,A1."
The differences on the InitOra are on these parameters:
Could they influence the Optimizer, and the execution plan are so different
background_dump_dest
cpu_count
db_file_multiblock_read_count
db_files
db_32k_cache_size
dml_locks
enqueue_resources
event
fast_start_mttr_target
fast_start_parallel_rollback
hash_area_size
log_buffer
log_parallelism
max_rollback_segments
open_cursors
open_links
parallel_execution_message_size
parallel_max_servers
processes
query_rewrite_enabled
remote_login_passwordfile
session_cached_cursors
sessions
sga_max_size
shared_pool_reserved_size
sort_area_retained_size
sort_area_size
star_transformation_enabled
transactions
undo_retention
user_dump_dest
utl_file_dir
Please Help me
Thanks a lot LucaHi Luca,
test and production system are nearly identicall (same OS, same HW Plattform, same software version, same release)
you're using external tables. Are the speed of these drives are identically?
have you analyzed the schema with the same statement? Could you send me the statement?
have you system statistics?
have you testet the statement in an environment which is nearly like the production? concurrent user etc.
Could you send me the top 5 wait events from the statspack report.
Are the data from production and test identical? No data changed. No Index drop? No additional Index? All tables and indexes are analyzed
Regards
Marc -
Spatial Query with multiple geometries from 2 tables
Hi,
I'm using Oracle 8.1.7. I am trying to do a spatial query on two tables with multiple geometries. There are two spatial tables. One made up of points and one made up of polygons. There are 829551 rows in the table of points and 1817795 rows in the table with polygons...
I want to find all polygons where one of this points is within it...
This query is pretty intensive querying two large spatial tables against each other and so I need to find the most efficient way of running this query. I've been running variations of my query for the last two week and every time it's bombed out with various errors after 12-24 hrs processing like out of memory, out of tablespace, out of processing, invalid index etc etc etc. I need to get this query run asap... Any tips would be gratefully appreciated..
For the session running the query I've allocated 16M sort area with
ALTER SESSION SET SORT_AREA_SIZE=16777216;
Below is the query I'm running... How can I improve this please? BTW PARCEL_OVERLAPS contains the points and TP$_PARCEL_AREAS the polygons.
SELECT lu.LNU_PARCEL_ID
FROM
seventy.PARCEL_OVERLAPS po,
imap_topol.TP$_PARCEL_AREAS pa,
TP$_PARCEL_CENTROID_AREA pca,
TDCR_LAND_UNIT lu
WHERE
SDO_FILTER(po.geometry, pa.area,
'querytype=WINDOW') = TRUE and
sdo_within_distance(po.geometry,pa.area,'distance=0')='TRUE' and
pa.delete_date is null and
Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
pa.AREA_ID = pca.AREA_ID and
pca.DELETE_DATE IS NULL and
pa.DELETE_DATE IS NULL;Albert,
Thanks for your reply and the tips you've given. The tp$_parcel_areas table will always be bigger so I've changed the order to sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE'. The requested counts for those queries are
12:26:29 [email protected]:SQL> select count(*)
13:46:22 2 from seventy.PARCEL_OVERLAPS;
COUNT(*)
612
13:48:12 [email protected]:SQL> select count(*)
13:48:17 2 from imap_topol.TP$_PARCEL_AREAS pa,
13:48:21 3 TP$_PARCEL_CENTROID_AREA pca
13:48:21 4 where pca.DELETE_DATE IS NULL
13:48:21 5 and pa.DELETE_DATE IS NULL
13:48:21 6 and pa.AREA_ID = pca.AREA_ID;
COUNT(*)
1310665
There was no reason for both filter and within_distance. I did try use the anyinteract but for some reason that does not return the desired results(I've added one id row as a test to make sure it returns desired results). Plus Oracle have recomended using the within distance for better performance..
so the explan plan for
14:38:37 [email protected]:SQL> EXPLAIN PLAN FOR
14:38:50 2 SELECT lu.LNU_PARCEL_ID
14:38:50 3 FROM
14:38:50 4 seventy.PARCEL_OVERLAPS po,
14:38:50 5 imap_topol.TP$_PARCEL_AREAS pa,
14:38:50 6 TP$_PARCEL_CENTROID_AREA pca,
14:38:50 7 TDCR_LAND_UNIT lu
14:38:50 8 WHERE
14:38:50 9 sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE' and
14:38:50 10 pa.delete_date is null and
14:38:50 11 Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
14:38:50 12 pa.AREA_ID = pca.AREA_ID and
14:38:50 13 pca.DELETE_DATE IS NULL and
14:38:50 14 pa.DELETE_DATE IS NULL;
is
Plan Table
| Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
| SELECT STATEMENT | | 4G|32920G| 547M| | |
| NESTED LOOPS | | 4G|32920G| 547M| | |
| MERGE JOIN | | 547M| 2029G| 230124 | | |
| SORT JOIN | | 1M| 36M| 85014 | | |
| MERGE JOIN | | 1M| 36M| 50019 | | |
| SORT JOIN | | 1M| 17M| 21650 | | |
| TABLE ACCESS FULL |TP$_PARCE | 1M| 17M| 485 | | |
| SORT JOIN | | 1M| 22M| 28369 | | |
| TABLE ACCESS FULL |TDCR_LAND | 1M| 22M| 2127 | | |
| SORT JOIN | | 42K| 160M| 145111 | | |
| TABLE ACCESS FULL |TP$_PARCE | 42K| 160M| 12697 | | |
| TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
14:43:14 [email protected]:SQL> explain plan for
14:43:23 2 SELECT pa.AREA_ID
14:43:23 3 FROM seventy.PARCEL_OVERLAPS po,
14:43:23 4 imap_topol.TP$_PARCEL_AREAS pa
14:43:23 5 WHERE SDO_RELATE(po.geometry, pa.area,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
14:43:23 6 and pa.DELETE_DATE IS NULL;
Plan Table
| Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
| SELECT STATEMENT | | 6M| 50G| 10M| | |
| NESTED LOOPS | | 6M| 50G| 10M| | |
| TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
| TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
14:45:03 [email protected]:SQL> explain plan for
14:45:04 2 SELECT pa.AREA_ID
14:45:05 3 FROM seventy.PARCEL_OVERLAPS po,
14:45:05 4 imap_topol.TP$_PARCEL_AREAS pa
14:45:05 5 WHERE SDO_RELATE(pa.area, po.geometry,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
14:45:05 6 and pa.DELETE_DATE IS NULL;
Plan Table
| Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
| SELECT STATEMENT | | 6M| 50G| 863554 | | |
| NESTED LOOPS | | 6M| 50G| 863554 | | |
| TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
| TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
-------------------------------------------------------------------------------- -
Help required on UNION ALL for select query
Hello all,
The execution plan for an SQL is impacted when another SELECT is concatenated with a UNION ALL. The two SELECTS are very efficient when run separately (< 100 buffer gets), but when run together (using a UNION ALL), the execution plan changes (for the first SELECT) and the buffer gets jumps to over 45000!
what customer says with the UNION ALL, Oracle instead of doing a Merge Scan (that allows the inner table to filter out the rows from the outer table), chooses to do a NL join. This results in a Unique Index scan for each one of the 15000 rows in the outer table, resulting in 46000 consistent gets.
Can you please suggest customer why plan changes when they use UNION ALL & also suggest better way of running query.
Please refer to below explain plan .
WITH THE UNIONS
===============
1 SELECT count(*)
2 FROM SOC_LIST SOC
3 WHERE
4 ( EXISTS( SELECT 1
5 FROM ELIGIBILITY_RELATION
6 WHERE SRC_CODE = 'SHDMM4215'
7 AND DEST_CODE = SOC.SOC
8 AND SRC_TYPE = 'P'
9 AND DEST_TYPE = 'S'))
10 UNION ALL
11 SELECT count(*)
12 FROM SOC_LIST SOC
13* WHERE ( = 'Y')
12:25:39 SQL> /
COUNT(*)
153
0
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=31 Card=2 Bytes=10)
1 0 UNION-ALL
2 1 SORT (AGGREGATE)
3 2 FILTER
4 3 TABLE ACCESS (FULL) OF 'SOC_LIST' (Cost=15 Card=749
Bytes=7490)
5 3 PARTITION HASH (SINGLE)
6 5 INDEX (UNIQUE SCAN) OF 'ELIGIBILITY_RELATION_PK' (
UNIQUE) (Cost=2 Card=1 Bytes=24)
7 1 SORT (AGGREGATE)
8 7 FILTER
9 8 TABLE ACCESS (FULL) OF 'SOC_LIST' (Cost=15 Card=1497
8)
Statistics
0 recursive calls
0 db block gets
46712 consistent gets <------large number
0 physical reads
0 redo size
215 bytes sent via SQL*Net to client
241 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
2 rows processed
12:25:40 SQL> ed
Wrote file C:/PADDY/AFIEDT.BUF
PART 1 of the UNION ALL
========================
1 SELECT count(*)
2 FROM SOC_LIST SOC
3 WHERE
4 ( EXISTS( SELECT 1
5 FROM ELIGIBILITY_RELATION
6 WHERE SRC_CODE = 'SHDMM4215'
7 AND DEST_CODE = SOC.SOC
8 AND SRC_TYPE = 'P'
9* AND DEST_TYPE = 'S'))
12:25:54 SQL> /
COUNT(*)
153
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=4 Card=1 Bytes=34)
1 0 SORT (AGGREGATE)
2 1 MERGE JOIN (SEMI) (Cost=4 Card=149 Bytes=5066)
3 2 INDEX (FULL SCAN) OF 'SOC_LIST_1IX' (NON-UNIQUE) (Cost
=41 Card=14978 Bytes=149780)
4 2 SORT (UNIQUE) (Cost=3 Card=149 Bytes=3576)
5 4 PARTITION HASH (ALL)
6 5 INDEX (RANGE SCAN) OF 'ELIGIBILITY_RELATION_PK' (U
NIQUE) (Cost=10 Card=149 Bytes=3576)
Statistics
0 recursive calls
0 db block gets
56 consistent gets
0 physical reads
0 redo size
218 bytes sent via SQL*Net to client
241 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
12:25:55 SQL> ed
Wrote file C:/PADDY/AFIEDT.BUF
PART 2 of the UNION ALL
========================
1 SELECT count(*)
2 FROM SOC_LIST SOC
3* WHERE ( = 'Y')
12:26:15 SQL> /
COUNT(*)
0
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=15 Card=1)
1 0 SORT (AGGREGATE)
2 1 FILTER
3 2 TABLE ACCESS (FULL) OF 'SOC_LIST' (Cost=15 Card=14978)
Statistics
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
215 bytes sent via SQL*Net to client
241 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
12:26:20 SQL> spool off
Same results but with theUNION ALL, the buffergets is massive ...
Thanks
Krishnai am also attaching 10043/10053 trace file .
/opt/oracle/adm/STCUST/udump/stcust_ora_7919_10046_10053_trace_file.trc
*** TRACE DUMP CONTINUED FROM FILE ***
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
ORACLE_HOME = /opt/oracle/product/9.2.0.8
System name: HP-UX
Node name: rcihp009
Release: B.11.23
Version: U
Machine: 9000/800
Instance name: STCUST
Redo thread mounted by this instance: 1
Oracle process number: 152
Unix process pid: 7919, image: oracle@rcihp009 (TNS V1-V3)
*** 2013-06-10 13:32:48.943
*** SESSION ID:(533.15875) 2013-06-10 13:32:48.943
APPNAME mod='SQL*Plus' mh=3669949024 act='' ah=4029777240
=====================
PARSING IN CURSOR #1 len=69 dep=0 uid=33 oct=42 lid=33 tim=3017585934213 hv=2004533713 ad='4aa33998'
alter session set events '10046 trace name context forever, level 12'
END OF STMT
EXEC #1:c=0,e=209,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017585933683
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:33:00.090
WAIT #1: nam='SQL*Net message from client' ela= 10884599 p1=1413697536 p2=1 p3=0
=====================
PARSING IN CURSOR #1 len=69 dep=0 uid=33 oct=42 lid=33 tim=3017596819944 hv=2030017677 ad='3af92970'
alter session set events '10053 trace name context forever, level 1'
END OF STMT
PARSE #1:c=0,e=484,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017596819933
BINDS #1:
EXEC #1:c=0,e=160,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017596820180
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:33:50.197
WAIT #1: nam='SQL*Net message from client' ela= 48932344 p1=1413697536 p2=1 p3=0
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
_OPTIMIZER_PERCENT_PARALLEL = 101
HASH_AREA_SIZE = 131072
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 65536
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
_ALWAYS_STAR_TRANSFORMATION = FALSE
_B_TREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
_COMPLEX_VIEW_MERGING = TRUE
_PUSH_JOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
_SYSTEM_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 1
OPTIMIZER_DYNAMIC_SAMPLING = 1
_OPTIMIZER_DYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = ENFORCED
_INDEX_JOIN_ENABLED = TRUE
_SORT_ELIMINATION_COST_RATIO = 0
_OR_EXPAND_NVL_PREDICATE = TRUE
_NEW_INITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
_OPTIMIZER_MODE_FORCE = TRUE
_OPTIMIZER_UNDO_CHANGES = FALSE
_UNNEST_SUBQUERY = TRUE
_PUSH_JOIN_UNION_VIEW = TRUE
_FAST_FULL_SCAN_ENABLED = TRUE
_OPTIM_ENHANCE_NNULL_DETECTION = TRUE
_ORDERED_NESTED_LOOP = TRUE
_NESTED_LOOP_FUDGE = 100
_NO_OR_EXPANSION = FALSE
_QUERY_COST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
_IMPROVED_ROW_LENGTH_ENABLED = TRUE
_USE_NOSEGMENT_INDEXES = FALSE
_ENABLE_TYPE_DEP_SELECTIVITY = TRUE
_IMPROVED_OUTERJOIN_CARD = TRUE
_OPTIMIZER_ADJUST_FOR_NULLS = TRUE
_OPTIMIZER_CHOOSE_PERMUTATION = 0
_USE_COLUMN_STATS_FOR_FUNCTION = TRUE
_SUBQUERY_PRUNING_ENABLED = TRUE
_SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
_SUBQUERY_PRUNING_COST_FACTOR = 20
_LIKE_WITH_BIND_AS_EQUALITY = FALSE
_TABLE_SCAN_COST_PLUS_ONE = TRUE
_SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
_DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
_ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
_OPTIMIZER_COST_MODEL = CHOOSE
_GSETS_ALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 128
_NEW_SORT_COST_ESTIMATE = TRUE
_GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
_CPU_TO_IO = 0
_PRED_MOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: SOC_LIST Alias: SOC
TOTAL :: CDN: 17584 NBLKS: 653 AVG_ROW_LEN: 260
Column: SOC Col#: 3 Table: SOC_LIST Alias: SOC
NDV: 17584 NULLS: 0 DENS: 5.6870e-05
NO HISTOGRAM: #BKT: 1 #VAL: 2
-- Index stats
INDEX NAME: I_SNAP$_SOC_LIST COL#: 1
TOTAL :: LVLS: 1 #LB: 64 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 699
INDEX NAME: SOC_LIST_1IX COL#: 3
TOTAL :: LVLS: 1 #LB: 47 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 14065
Table stats Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
(Using composite stats)
TOTAL :: CDN: 11982220 NBLKS: 125493 AVG_ROW_LEN: 71
-- Index stats
INDEX NAME: ELIGIBILITY_RELATION_1IX COL#: 3 4 5
USING COMPOSITE STATS
TOTAL :: LVLS: 2 #LB: 38360 #DK: 4164 LB/K: 9 DB/K: 740 CLUF: 3081860
INDEX NAME: ELIGIBILITY_RELATION_PK COL#: 2 3 4 5
USING COMPOSITE STATS
TOTAL :: LVLS: 2 #LB: 50740 #DK: 11873160 LB/K: 1 DB/K: 1 CLUF: 9158280
INDEX NAME: I_SNAP$_ELIGIBILITY_RELATI COL#: 1
TOTAL :: LVLS: 2 #LB: 49600 #DK: 11953600 LB/K: 1 DB/K: 1 CLUF: 8833300
_OPTIMIZER_PERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
Column: SRC_CODE Col#: 2 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 22087 NULLS: 0 DENS: 4.5276e-05
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: SRC_TYPE Col#: 3 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 2 NULLS: 0 DENS: 5.0000e-01
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: DEST_TYPE Col#: 5 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 2 NULLS: 0 DENS: 5.0000e-01
NO HISTOGRAM: #BKT: 1 #VAL: 2
TABLE: ELIGIBILITY_RELATION ORIG CDN: 11982220 ROUNDED CDN: 136 CMPTD CDN: 136
Access path: tsc Resc: 3072 Resp: 3072
Access path: index (iff)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 1243
IX_SEL: 0.0000e+00 TB_SEL: 1.0000e+00
Access path: iff Resc: 1243 Resp: 1243
Skip scan: ss-sel 0 andv 11970
ss cost 119700
index io scan cost 19180
Access path: index (scan)
Index: ELIGIBILITY_RELATION_1IX
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 789653
IX_SEL: 5.0000e-01 TB_SEL: 2.5000e-01
Skip scan: ss-sel 0 andv 11970
ss cost 11970
index io scan cost 2
Access path: index (index-only)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 10
IX_SEL: 2.2638e-05 TB_SEL: 2.2638e-05
****** trying bitmap/domain indexes ******
****** finished trying bitmap/domain indexes ******
BEST_CST: 1.00 PATH: 4 Degree: 1
SINGLE TABLE ACCESS PATH
TABLE: SOC_LIST ORIG CDN: 17584 ROUNDED CDN: 17584 CMPTD CDN: 17584
Access path: tsc Resc: 18 Resp: 18
Access path: index (iff)
Index: SOC_LIST_1IX
TABLE: SOC_LIST
RSC_CPU: 0 RSC_IO: 3
IX_SEL: 0.0000e+00 TB_SEL: 1.0000e+00
Access path: iff Resc: 3 Resp: 3
Access path: index (no sta/stp keys)
Index: SOC_LIST_1IX
TABLE: SOC_LIST
RSC_CPU: 0 RSC_IO: 48
IX_SEL: 1.0000e+00 TB_SEL: 1.0000e+00
BEST_CST: 1.00 PATH: 4 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: SOC_LIST[SOC]#0 ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#1
Now joining: ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#1 *******
NL Join
Outer table: cost: 1 cdn: 17584 rcz: 10 resp: 1
Inner table: ELIGIBILITY_RELATION
Access path: tsc Resc: 768
Join: Resc: 13504513 Resp: 13504513
Access path: index (iff)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 1243
IX_SEL: 0.0000e+00 TB_SEL: 1.0000e+00
Inner table: ELIGIBILITY_RELATION
Access path: iff Resc: 311
Join: Resc: 5464229 Resp: 5464229
Access path: index (unique)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 1
IX_SEL: 8.3457e-08 TB_SEL: 8.3457e-08
Join: resc: 177 resp: 177
Access path: index (join index)
Index: ELIGIBILITY_RELATION_1IX
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 750
IX_SEL: 0.0000e+00 TB_SEL: 2.0886e-05
Join: resc: 131881 resp: 131881
Access path: index (eq-unique)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 1
IX_SEL: 0.0000e+00 TB_SEL: 0.0000e+00
Join: resc: 177 resp: 177
****** trying bitmap/domain indexes ******
Access path: index (join index)
Index: ELIGIBILITY_RELATION_1IX
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 10
IX_SEL: 1.4217e-05 TB_SEL: 2.0886e-05
Join: resc: 1759 resp: 1759
Access path: index (index-only)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 4
IX_SEL: 4.5276e-05 TB_SEL: 4.5276e-05
Join: resc: 704 resp: 704
SORT resource Sort statistics
Sort width: 11 Area size: 628736 Max Area size: 31457280 Degree: 1
Blocks to Sort: 2 Row size: 21 Rows: 543
Initial runs: 1 Merge passes: 1 IO Cost / pass: 3
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
****** finished trying bitmap/domain indexes ******
Best NL cost: 177 resp: 177
Semi-join cardinality: 135 = outer (17584) * sel (7.6774e-03) [flag=12]
SM Join
Outer table:
resc: 1 cdn: 17584 rcz: 10 deg: 1 resp: 1
Inner table: ELIGIBILITY_RELATION
resc: 1 cdn: 136 rcz: 24 deg: 1 resp: 1
using join:1 distribution:2 #groups:1
SORT resource Sort statistics
Sort width: 11 Area size: 628736 Max Area size: 31457280 Degree: 1
Blocks to Sort: 1 Row size: 37 Rows: 136
Initial runs: 1 Merge passes: 1 IO Cost / pass: 2
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
Merge join Cost: 4 Resp: 4
HA Join
Outer table:
resc: 1 cdn: 17584 rcz: 10 deg: 1 resp: 1
Inner table: ELIGIBILITY_RELATION
resc: 1 cdn: 136 rcz: 24 deg: 1 resp: 1
using join:8 distribution:2 #groups:1
Hash join one ptn Resc: 4 Deg: 1
hash_area: 154 (max=7680) buildfrag: 48 probefrag: 1 ppasses: 1
Hash join Resc: 6 Resp: 6
Join result: cost: 4 cdn: 135 rcz: 34
Best so far: TABLE#: 0 CST: 1 CDN: 17584 BYTES: 175840
Best so far: TABLE#: 1 CST: 4 CDN: 135 BYTES: 4590
Join order[2]: ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#1 SOC_LIST[SOC]#0
SORT resource Sort statistics
Sort width: 11 Area size: 628736 Max Area size: 31457280 Degree: 1
Blocks to Sort: 1 Row size: 37 Rows: 136
Initial runs: 1 Merge passes: 1 IO Cost / pass: 2
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
Now joining: SOC_LIST[SOC]#0 *******
NL Join
Outer table: cost: 3 cdn: 136 rcz: 24 resp: 2
Inner table: SOC_LIST
Access path: tsc Resc: 18
Join: Resc: 2450 Resp: 2450
Access path: index (iff)
Index: SOC_LIST_1IX
TABLE: SOC_LIST
RSC_CPU: 0 RSC_IO: 3
IX_SEL: 0.0000e+00 TB_SEL: 1.0000e+00
Inner table: SOC_LIST
Access path: iff Resc: 3
Join: Resc: 410 Resp: 410
Access path: index (join index)
Index: SOC_LIST_1IX
TABLE: SOC_LIST
RSC_CPU: 0 RSC_IO: 1
IX_SEL: 0.0000e+00 TB_SEL: 5.6870e-05
Join: resc: 4 resp: 4
Best NL cost: 4 resp: 4
Join cardinality: 136 = outer (136) * inner (17584) * sel (5.6870e-05) [flag=0]
SM Join
Outer table:
resc: 2 cdn: 136 rcz: 24 deg: 1 resp: 2
Inner table: SOC_LIST
resc: 1 cdn: 17584 rcz: 10 deg: 1 resp: 1
using join:1 distribution:2 #groups:1
SORT resource Sort statistics
Sort width: 11 Area size: 628736 Max Area size: 31457280 Degree: 1
Blocks to Sort: 1 Row size: 37 Rows: 136
Initial runs: 1 Merge passes: 1 IO Cost / pass: 2
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
SORT resource Sort statistics
Sort width: 11 Area size: 628736 Max Area size: 31457280 Degree: 1
Blocks to Sort: 46 Row size: 21 Rows: 17584
Initial runs: 1 Merge passes: 1 IO Cost / pass: 51
Total IO sort cost: 48
Total CPU sort cost: 0
Total Temp space used: 0
Merge join Cost: 54 Resp: 54
HA Join
Outer table:
resc: 2 cdn: 136 rcz: 24 deg: 1 resp: 2
Inner table: SOC_LIST
resc: 1 cdn: 17584 rcz: 10 deg: 1 resp: 1
using join:8 distribution:2 #groups:1
Hash join one ptn Resc: 1 Deg: 1
hash_area: 154 (max=7680) buildfrag: 1 probefrag: 48 ppasses: 1
Hash join Resc: 4 Resp: 4
Final - All Rows Plan:
JOIN ORDER: 1
CST: 4 CDN: 135 RSC: 4 RSP: 4 BYTES: 4590
IO-RSC: 4 IO-RSP: 4 CPU-RSC: 0 CPU-RSP: 0
QUERY
SELECT count(*)
FROM SOC_LIST SOC
WHERE
( EXISTS( SELECT 1
FROM ELIGIBILITY_RELATION
WHERE SRC_CODE = 'SHDMM4215'
AND DEST_CODE = SOC.SOC
AND SRC_TYPE = 'P'
AND DEST_TYPE = 'S'))
=====================
PARSING IN CURSOR #1 len=278 dep=0 uid=33 oct=3 lid=33 tim=3017645761269 hv=183981413 ad='492d5bb0'
SELECT count(*)
FROM SOC_LIST SOC
WHERE
( EXISTS( SELECT 1
FROM ELIGIBILITY_RELATION
WHERE SRC_CODE = 'SHDMM4215'
AND DEST_CODE = SOC.SOC
AND SRC_TYPE = 'P'
AND DEST_TYPE = 'S'))
END OF STMT
PARSE #1:c=10000,e=8343,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017645761258
BINDS #1:
EXEC #1:c=0,e=529,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017645761970
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
WAIT #1: nam='db file sequential read' ela= 9290 p1=2535 p2=142378 p3=1
WAIT #1: nam='db file sequential read' ela= 2098 p1=2535 p2=142379 p3=1
WAIT #1: nam='db file sequential read' ela= 11574 p1=2535 p2=33834 p3=1
WAIT #1: nam='db file sequential read' ela= 10290 p1=2536 p2=60958 p3=1
WAIT #1: nam='db file sequential read' ela= 11469 p1=2535 p2=61232 p3=1
WAIT #1: nam='db file sequential read' ela= 378 p1=2535 p2=61233 p3=1
WAIT #1: nam='db file sequential read' ela= 5493 p1=2535 p2=39498 p3=1
WAIT #1: nam='db file sequential read' ela= 7397 p1=2536 p2=68185 p3=1
WAIT #1: nam='db file sequential read' ela= 10037 p1=2536 p2=68520 p3=1
WAIT #1: nam='db file sequential read' ela= 16125 p1=2535 p2=68809 p3=1
WAIT #1: nam='db file sequential read' ela= 12426 p1=2535 p2=45162 p3=1
WAIT #1: nam='db file sequential read' ela= 12447 p1=2535 p2=178335 p3=1
WAIT #1: nam='db file sequential read' ela= 5974 p1=2535 p2=178798 p3=1
WAIT #1: nam='db file sequential read' ela= 1247 p1=2535 p2=178799 p3=1
WAIT #1: nam='db file sequential read' ela= 11010 p1=2535 p2=50826 p3=1
WAIT #1: nam='db file sequential read' ela= 5421 p1=2536 p2=260451 p3=1
WAIT #1: nam='db file sequential read' ela= 8230 p1=2536 p2=261538 p3=1
WAIT #1: nam='db file sequential read' ela= 350 p1=2535 p2=142380 p3=1
WAIT #1: nam='db file sequential read' ela= 346 p1=2535 p2=142381 p3=1
WAIT #1: nam='db file sequential read' ela= 343 p1=2535 p2=142382 p3=1
WAIT #1: nam='db file sequential read' ela= 480 p1=2535 p2=142383 p3=1
WAIT #1: nam='db file sequential read' ela= 10237 p1=2535 p2=142384 p3=1
WAIT #1: nam='db file sequential read' ela= 324 p1=2535 p2=142385 p3=1
WAIT #1: nam='db file sequential read' ela= 359 p1=2535 p2=142386 p3=1
WAIT #1: nam='db file sequential read' ela= 361 p1=2535 p2=142387 p3=1
WAIT #1: nam='db file sequential read' ela= 375 p1=2535 p2=142388 p3=1
WAIT #1: nam='db file sequential read' ela= 425 p1=2535 p2=142389 p3=1
WAIT #1: nam='db file sequential read' ela= 540 p1=2535 p2=142390 p3=1
WAIT #1: nam='db file sequential read' ela= 368 p1=2535 p2=142391 p3=1
WAIT #1: nam='db file sequential read' ela= 479 p1=2535 p2=142392 p3=1
WAIT #1: nam='db file sequential read' ela= 450 p1=2535 p2=142393 p3=1
WAIT #1: nam='db file sequential read' ela= 307 p1=2535 p2=142394 p3=1
WAIT #1: nam='db file sequential read' ela= 324 p1=2535 p2=142395 p3=1
WAIT #1: nam='db file sequential read' ela= 396 p1=2535 p2=142396 p3=1
WAIT #1: nam='db file sequential read' ela= 376 p1=2535 p2=142397 p3=1
WAIT #1: nam='db file sequential read' ela= 295 p1=2535 p2=142398 p3=1
WAIT #1: nam='db file sequential read' ela= 391 p1=2535 p2=142399 p3=1
WAIT #1: nam='db file sequential read' ela= 396 p1=2535 p2=142400 p3=1
WAIT #1: nam='db file sequential read' ela= 344 p1=2535 p2=142401 p3=1
WAIT #1: nam='db file sequential read' ela= 337 p1=2535 p2=142402 p3=1
WAIT #1: nam='db file sequential read' ela= 360 p1=2535 p2=142403 p3=1
WAIT #1: nam='db file sequential read' ela= 402 p1=2535 p2=142404 p3=1
WAIT #1: nam='db file sequential read' ela= 343 p1=2535 p2=142405 p3=1
WAIT #1: nam='db file sequential read' ela= 408 p1=2535 p2=142406 p3=1
WAIT #1: nam='db file sequential read' ela= 388 p1=2535 p2=142407 p3=1
WAIT #1: nam='db file sequential read' ela= 400 p1=2535 p2=142408 p3=1
WAIT #1: nam='db file sequential read' ela= 7999 p1=2536 p2=617 p3=1
WAIT #1: nam='db file sequential read' ela= 520 p1=2536 p2=618 p3=1
WAIT #1: nam='db file sequential read' ela= 294 p1=2536 p2=619 p3=1
WAIT #1: nam='db file sequential read' ela= 311 p1=2536 p2=620 p3=1
WAIT #1: nam='db file sequential read' ela= 316 p1=2536 p2=621 p3=1
WAIT #1: nam='db file sequential read' ela= 306 p1=2536 p2=622 p3=1
WAIT #1: nam='db file sequential read' ela= 303 p1=2536 p2=623 p3=1
WAIT #1: nam='db file sequential read' ela= 1776 p1=2536 p2=624 p3=1
FETCH #1:c=50000,e=216800,p=54,cr=54,cu=0,mis=0,r=1,dep=0,og=4,tim=3017645978865
WAIT #1: nam='SQL*Net message from client' ela= 2802 p1=1413697536 p2=1 p3=0
FETCH #1:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=3017645981803
WAIT #1: nam='SQL*Net message to client' ela= 1 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:34:28.160
WAIT #1: nam='SQL*Net message from client' ela= 36844121 p1=1413697536 p2=1 p3=0
STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=54 r=54 w=0 time=216788 us)'
STAT #1 id=2 cnt=157 pid=1 pos=1 obj=0 op='MERGE JOIN SEMI (cr=54 r=54 w=0 time=216734 us)'
STAT #1 id=3 cnt=14296 pid=2 pos=1 obj=5769123 op='INDEX FULL SCAN SOC_LIST_1IX (cr=39 r=39 w=0 time=55399 us)'
STAT #1 id=4 cnt=157 pid=2 pos=2 obj=0 op='SORT UNIQUE (cr=15 r=15 w=0 time=141933 us)'
STAT #1 id=5 cnt=286 pid=4 pos=1 obj=0 op='PARTITION HASH ALL PARTITION: 1 4 (cr=15 r=15 w=0 time=130847 us)'
STAT #1 id=6 cnt=286 pid=5 pos=1 obj=5401812 op='INDEX RANGE SCAN ELIGIBILITY_RELATION_PK PARTITION: 1 4 (cr=15 r=15 w=0 time=130716 us)'
QUERY
BEGIN := 'N'; END;
=====================
PARSING IN CURSOR #1 len=23 dep=0 uid=33 oct=47 lid=33 tim=3017682828223 hv=16287806 ad='464edb18'
BEGIN := 'N'; END;
END OF STMT
PARSE #1:c=0,e=1569,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=3017682828214
BINDS #1:
bind 0: dty=96 mxl=01(01) mal=00 scl=00 pre=00 oacflg=03 oacfl2=200071100000000 size=8 offset=0
bfp=800003ffefe9f748 bln=01 avl=00 flg=05
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
EXEC #1:c=0,e=5494,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=3017682833795
*** 2013-06-10 13:34:44.174
WAIT #1: nam='SQL*Net message from client' ela= 15630899 p1=1413697536 p2=1 p3=0
QUERY
SELECT count(*)
FROM SOC_LIST SOC
WHERE ( = 'Y')
=====================
PARSING IN CURSOR #1 len=65 dep=0 uid=33 oct=3 lid=33 tim=3017698466665 hv=900106749 ad='43145458'
SELECT count(*)
FROM SOC_LIST SOC
WHERE ( = 'Y')
END OF STMT
PARSE #1:c=0,e=1409,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=3017698466654
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
_OPTIMIZER_PERCENT_PARALLEL = 101
HASH_AREA_SIZE = 131072
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 65536
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
_ALWAYS_STAR_TRANSFORMATION = FALSE
_B_TREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
_COMPLEX_VIEW_MERGING = TRUE
_PUSH_JOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
_SYSTEM_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 1
OPTIMIZER_DYNAMIC_SAMPLING = 1
_OPTIMIZER_DYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = ENFORCED
_INDEX_JOIN_ENABLED = TRUE
_SORT_ELIMINATION_COST_RATIO = 0
_OR_EXPAND_NVL_PREDICATE = TRUE
_NEW_INITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
_OPTIMIZER_MODE_FORCE = TRUE
_OPTIMIZER_UNDO_CHANGES = FALSE
_UNNEST_SUBQUERY = TRUE
_PUSH_JOIN_UNION_VIEW = TRUE
_FAST_FULL_SCAN_ENABLED = TRUE
_OPTIM_ENHANCE_NNULL_DETECTION = TRUE
_ORDERED_NESTED_LOOP = TRUE
_NESTED_LOOP_FUDGE = 100
_NO_OR_EXPANSION = FALSE
_QUERY_COST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
_IMPROVED_ROW_LENGTH_ENABLED = TRUE
_USE_NOSEGMENT_INDEXES = FALSE
_ENABLE_TYPE_DEP_SELECTIVITY = TRUE
_IMPROVED_OUTERJOIN_CARD = TRUE
_OPTIMIZER_ADJUST_FOR_NULLS = TRUE
_OPTIMIZER_CHOOSE_PERMUTATION = 0
_USE_COLUMN_STATS_FOR_FUNCTION = TRUE
_SUBQUERY_PRUNING_ENABLED = TRUE
_SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
_SUBQUERY_PRUNING_COST_FACTOR = 20
_LIKE_WITH_BIND_AS_EQUALITY = FALSE
_TABLE_SCAN_COST_PLUS_ONE = TRUE
_SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
_DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
_ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
_OPTIMIZER_COST_MODEL = CHOOSE
_GSETS_ALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 128
_NEW_SORT_COST_ESTIMATE = TRUE
_GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
_CPU_TO_IO = 0
_PRED_MOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: SOC_LIST Alias: SOC
TOTAL :: CDN: 17584 NBLKS: 653 AVG_ROW_LEN: 260
-- Index stats
INDEX NAME: I_SNAP$_SOC_LIST COL#: 1
TOTAL :: LVLS: 1 #LB: 64 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 699
INDEX NAME: SOC_LIST_1IX COL#: 3
TOTAL :: LVLS: 1 #LB: 47 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 14065
_OPTIMIZER_PERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
TABLE: SOC_LIST ORIG CDN: 17584 ROUNDED CDN: 17584 CMPTD CDN: 17584
Access path: tsc Resc: 18 Resp: 18
****** trying bitmap/domain indexes ******
****** finished trying bitmap/domain indexes ******
BEST_CST: 18.00 PATH: 2 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: SOC_LIST[SOC]#0
Best so far: TABLE#: 0 CST: 18 CDN: 17584 BYTES: 0
Final - All Rows Plan:
JOIN ORDER: 1
CST: 18 CDN: 17584 RSC: 18 RSP: 18 BYTES: 0
IO-RSC: 18 IO-RSP: 18 CPU-RSC: 0 CPU-RSP: 0
BINDS #1:
bind 0: dty=96 mxl=32(01) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=32 offset=0
bfp=800003ffefea9490 bln=32 avl=01 flg=05
value="N"
EXEC #1:c=0,e=152,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017698469481
WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
FETCH #1:c=10000,e=1506,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=3017698471536
WAIT #1: nam='SQL*Net message from client' ela= 2607 p1=1413697536 p2=1 p3=0
FETCH #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=3017698474268
WAIT #1: nam='SQL*Net message to client' ela= 1 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:35:07.656
WAIT #1: nam='SQL*Net message from client' ela= 22922584 p1=1413697536 p2=1 p3=0
STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=0 r=0 w=0 time=93 us)'
STAT #1 id=2 cnt=0 pid=1 pos=1 obj=0 op='FILTER (cr=0 r=0 w=0 time=29 us)'
STAT #1 id=3 cnt=0 pid=2 pos=1 obj=5769120 op='TABLE ACCESS FULL SOC_LIST '
=====================
PARSE ERROR #1:len=369 dep=0 uid=33 oct=0 lid=33 tim=3017721397730 err=900
exec := 'N'
SELEC ...
WAIT #1: nam='SQL*Net break/reset to client' ela= 2 p1=1413697536 p2=1 p3=0
WAIT #1: nam='SQL*Net break/reset to client' ela= 2403 p1=1413697536 p2=0 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:35:24.017
WAIT #1: nam='SQL*Net message from client' ela= 15973854 p1=1413697536 p2=1 p3=0
QUERY
SELECT count(*)
FROM SOC_LIST SOC
WHERE
( EXISTS( SELECT 1
FROM ELIGIBILITY_RELATION
WHERE SRC_CODE = 'SHDMM4215'
AND DEST_CODE = SOC.SOC
AND SRC_TYPE = 'P'
AND DEST_TYPE = 'S'))
UNION ALL
SELECT count(*)
FROM SOC_LIST SOC
WHERE ( = 'Y')
=====================
PARSING IN CURSOR #1 len=353 dep=0 uid=33 oct=3 lid=33 tim=3017737377655 hv=4202798596 ad='45639568'
SELECT count(*)
FROM SOC_LIST SOC
WHERE
( EXISTS( SELECT 1
FROM ELIGIBILITY_RELATION
WHERE SRC_CODE = 'SHDMM4215'
AND DEST_CODE = SOC.SOC
AND SRC_TYPE = 'P'
AND DEST_TYPE = 'S'))
UNION ALL
SELECT count(*)
FROM SOC_LIST SOC
WHERE ( = 'Y')
END OF STMT
PARSE #1:c=0,e=2624,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=3017737377644
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
_OPTIMIZER_PERCENT_PARALLEL = 101
HASH_AREA_SIZE = 131072
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 65536
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
_ALWAYS_STAR_TRANSFORMATION = FALSE
_B_TREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
_COMPLEX_VIEW_MERGING = TRUE
_PUSH_JOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
_SYSTEM_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 1
OPTIMIZER_DYNAMIC_SAMPLING = 1
_OPTIMIZER_DYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = ENFORCED
_INDEX_JOIN_ENABLED = TRUE
_SORT_ELIMINATION_COST_RATIO = 0
_OR_EXPAND_NVL_PREDICATE = TRUE
_NEW_INITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
_OPTIMIZER_MODE_FORCE = TRUE
_OPTIMIZER_UNDO_CHANGES = FALSE
_UNNEST_SUBQUERY = TRUE
_PUSH_JOIN_UNION_VIEW = TRUE
_FAST_FULL_SCAN_ENABLED = TRUE
_OPTIM_ENHANCE_NNULL_DETECTION = TRUE
_ORDERED_NESTED_LOOP = TRUE
_NESTED_LOOP_FUDGE = 100
_NO_OR_EXPANSION = FALSE
_QUERY_COST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
_IMPROVED_ROW_LENGTH_ENABLED = TRUE
_USE_NOSEGMENT_INDEXES = FALSE
_ENABLE_TYPE_DEP_SELECTIVITY = TRUE
_IMPROVED_OUTERJOIN_CARD = TRUE
_OPTIMIZER_ADJUST_FOR_NULLS = TRUE
_OPTIMIZER_CHOOSE_PERMUTATION = 0
_USE_COLUMN_STATS_FOR_FUNCTION = TRUE
_SUBQUERY_PRUNING_ENABLED = TRUE
_SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
_SUBQUERY_PRUNING_COST_FACTOR = 20
_LIKE_WITH_BIND_AS_EQUALITY = FALSE
_TABLE_SCAN_COST_PLUS_ONE = TRUE
_SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
_DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
_ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
_OPTIMIZER_COST_MODEL = CHOOSE
_GSETS_ALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 128
_NEW_SORT_COST_ESTIMATE = TRUE
_GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
_CPU_TO_IO = 0
_PRED_MOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
(Using composite stats)
(adjusted for partition skews)
ORIG STATS:: CDN: 11982220 NBLKS: 125493 AVG_ROW_LEN: 71
PARTCNT::
PRUNED: 4 ANALYZED: 4 UNANALYZED: 0
TOTAL :: CDN: 11982220 NBLKS: 125493 AVG_ROW_LEN: 71
-- Index stats
INDEX NAME: ELIGIBILITY_RELATION_1IX COL#: 3 4 5
USING COMPOSITE STATS
TOTAL :: LVLS: 2 #LB: 38360 #DK: 4164 LB/K: 9 DB/K: 740 CLUF: 3081860
INDEX NAME: ELIGIBILITY_RELATION_PK COL#: 2 3 4 5
USING COMPOSITE STATS
TOTAL :: LVLS: 2 #LB: 50740 #DK: 11873160 LB/K: 1 DB/K: 1 CLUF: 9158280
INDEX NAME: I_SNAP$_ELIGIBILITY_RELATI COL#: 1
TOTAL :: LVLS: 2 #LB: 49600 #DK: 11953600 LB/K: 1 DB/K: 1 CLUF: 8833300
_OPTIMIZER_PERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
Column: SRC_CODE Col#: 2 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 22087 NULLS: 0 DENS: 4.5276e-05
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: DEST_CODE Col#: 4 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 11970 NULLS: 0 DENS: 8.3542e-05
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: SRC_TYPE Col#: 3 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 2 NULLS: 0 DENS: 5.0000e-01
NO HISTOGRAM: #BKT: 1 #VAL: 2
Column: DEST_TYPE Col#: 5 Table: ELIGIBILITY_RELATION Alias: ELIGIBILITY_RELATION
NDV: 2 NULLS: 0 DENS: 5.0000e-01
NO HISTOGRAM: #BKT: 1 #VAL: 2
TABLE: ELIGIBILITY_RELATION ORIG CDN: 11982220 ROUNDED CDN: 1 CMPTD CDN: 0
Access path: tsc Resc: 3072 Resp: 3072
Access path: index (iff)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 1243
IX_SEL: 0.0000e+00 TB_SEL: 1.0000e+00
Access path: iff Resc: 1243 Resp: 1243
Access path: index (unique)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 2
IX_SEL: 8.3457e-08 TB_SEL: 8.3457e-08
Access path: index (equal)
Index: ELIGIBILITY_RELATION_1IX
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 68
IX_SEL: 0.0000e+00 TB_SEL: 2.0886e-05
Access path: index (eq-unique)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 2
IX_SEL: 0.0000e+00 TB_SEL: 0.0000e+00
****** trying bitmap/domain indexes ******
Access path: index (equal)
Index: ELIGIBILITY_RELATION_1IX
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 3
IX_SEL: 2.0886e-05 TB_SEL: 2.0886e-05
Access path: index (index-only)
Index: ELIGIBILITY_RELATION_PK
TABLE: ELIGIBILITY_RELATION
RSC_CPU: 0 RSC_IO: 5
IX_SEL: 4.5276e-05 TB_SEL: 4.5276e-05
SORT resource Sort statistics
Sort width: 11 Area size: 628736 Max Area size: 31457280 Degree: 1
Blocks to Sort: 2 Row size: 21 Rows: 543
Initial runs: 1 Merge passes: 1 IO Cost / pass: 3
Total IO sort cost: 2
Total CPU sort cost: 0
Total Temp space used: 0
****** finished trying bitmap/domain indexes ******
One row CDN: 1
BEST_CST: 1.00 PATH: 3 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#0
Best so far: TABLE#: 0 CST: 1 CDN: 1 BYTES: 24
Final - First Rows Plan:
JOIN ORDER: 1
CST: 1 CDN: 1 RSC: 1 RSP: 1 BYTES: 24
IO-RSC: 1 IO-RSP: 1 CPU-RSC: 0 CPU-RSP: 0
First Rows Plan
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
_OPTIMIZER_PERCENT_PARALLEL = 101
HASH_AREA_SIZE = 131072
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 65536
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
_ALWAYS_STAR_TRANSFORMATION = FALSE
_B_TREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
_COMPLEX_VIEW_MERGING = TRUE
_PUSH_JOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
_SYSTEM_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 1
OPTIMIZER_DYNAMIC_SAMPLING = 1
_OPTIMIZER_DYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = ENFORCED
_INDEX_JOIN_ENABLED = TRUE
_SORT_ELIMINATION_COST_RATIO = 0
_OR_EXPAND_NVL_PREDICATE = TRUE
_NEW_INITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
_OPTIMIZER_MODE_FORCE = TRUE
_OPTIMIZER_UNDO_CHANGES = FALSE
_UNNEST_SUBQUERY = TRUE
_PUSH_JOIN_UNION_VIEW = TRUE
_FAST_FULL_SCAN_ENABLED = TRUE
_OPTIM_ENHANCE_NNULL_DETECTION = TRUE
_ORDERED_NESTED_LOOP = TRUE
_NESTED_LOOP_FUDGE = 100
_NO_OR_EXPANSION = FALSE
_QUERY_COST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
_IMPROVED_ROW_LENGTH_ENABLED = TRUE
_USE_NOSEGMENT_INDEXES = FALSE
_ENABLE_TYPE_DEP_SELECTIVITY = TRUE
_IMPROVED_OUTERJOIN_CARD = TRUE
_OPTIMIZER_ADJUST_FOR_NULLS = TRUE
_OPTIMIZER_CHOOSE_PERMUTATION = 0
_USE_COLUMN_STATS_FOR_FUNCTION = TRUE
_SUBQUERY_PRUNING_ENABLED = TRUE
_SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
_SUBQUERY_PRUNING_COST_FACTOR = 20
_LIKE_WITH_BIND_AS_EQUALITY = FALSE
_TABLE_SCAN_COST_PLUS_ONE = TRUE
_SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
_DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
_ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
_OPTIMIZER_COST_MODEL = CHOOSE
_GSETS_ALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 128
_NEW_SORT_COST_ESTIMATE = TRUE
_GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
_CPU_TO_IO = 0
_PRED_MOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: SOC_LIST Alias: SYS_ALIAS_1
TOTAL :: CDN: 17584 NBLKS: 653 AVG_ROW_LEN: 260
-- Index stats
INDEX NAME: I_SNAP$_SOC_LIST COL#: 1
TOTAL :: LVLS: 1 #LB: 64 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 699
INDEX NAME: SOC_LIST_1IX COL#: 3
TOTAL :: LVLS: 1 #LB: 47 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 14065
_OPTIMIZER_PERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
TABLE: SOC_LIST ORIG CDN: 17584 ROUNDED CDN: 879 CMPTD CDN: 879
Access path: tsc Resc: 18 Resp: 18
****** trying bitmap/domain indexes ******
****** finished trying bitmap/domain indexes ******
BEST_CST: 18.00 PATH: 2 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: SOC_LIST[SYS_ALIAS_1]#0
Best so far: TABLE#: 0 CST: 18 CDN: 879 BYTES: 8790
Final - All Rows Plan:
JOIN ORDER: 1
CST: 18 CDN: 879 RSC: 18 RSP: 18 BYTES: 8790
IO-RSC: 18 IO-RSP: 18 CPU-RSC: 0 CPU-RSP: 0
PARAMETERS USED BY THE OPTIMIZER
OPTIMIZER_FEATURES_ENABLE = 9.2.0
OPTIMIZER_MODE/GOAL = Choose
_OPTIMIZER_PERCENT_PARALLEL = 101
HASH_AREA_SIZE = 131072
HASH_JOIN_ENABLED = TRUE
HASH_MULTIBLOCK_IO_COUNT = 0
SORT_AREA_SIZE = 65536
OPTIMIZER_SEARCH_LIMIT = 5
PARTITION_VIEW_ENABLED = FALSE
_ALWAYS_STAR_TRANSFORMATION = FALSE
_B_TREE_BITMAP_PLANS = TRUE
STAR_TRANSFORMATION_ENABLED = FALSE
_COMPLEX_VIEW_MERGING = TRUE
_PUSH_JOIN_PREDICATE = TRUE
PARALLEL_BROADCAST_ENABLED = TRUE
OPTIMIZER_MAX_PERMUTATIONS = 2000
OPTIMIZER_INDEX_CACHING = 0
_SYSTEM_INDEX_CACHING = 0
OPTIMIZER_INDEX_COST_ADJ = 1
OPTIMIZER_DYNAMIC_SAMPLING = 1
_OPTIMIZER_DYN_SMP_BLKS = 32
QUERY_REWRITE_ENABLED = TRUE
QUERY_REWRITE_INTEGRITY = ENFORCED
_INDEX_JOIN_ENABLED = TRUE
_SORT_ELIMINATION_COST_RATIO = 0
_OR_EXPAND_NVL_PREDICATE = TRUE
_NEW_INITIAL_JOIN_ORDERS = TRUE
ALWAYS_ANTI_JOIN = CHOOSE
ALWAYS_SEMI_JOIN = CHOOSE
_OPTIMIZER_MODE_FORCE = TRUE
_OPTIMIZER_UNDO_CHANGES = FALSE
_UNNEST_SUBQUERY = TRUE
_PUSH_JOIN_UNION_VIEW = TRUE
_FAST_FULL_SCAN_ENABLED = TRUE
_OPTIM_ENHANCE_NNULL_DETECTION = TRUE
_ORDERED_NESTED_LOOP = TRUE
_NESTED_LOOP_FUDGE = 100
_NO_OR_EXPANSION = FALSE
_QUERY_COST_REWRITE = TRUE
QUERY_REWRITE_EXPRESSION = TRUE
_IMPROVED_ROW_LENGTH_ENABLED = TRUE
_USE_NOSEGMENT_INDEXES = FALSE
_ENABLE_TYPE_DEP_SELECTIVITY = TRUE
_IMPROVED_OUTERJOIN_CARD = TRUE
_OPTIMIZER_ADJUST_FOR_NULLS = TRUE
_OPTIMIZER_CHOOSE_PERMUTATION = 0
_USE_COLUMN_STATS_FOR_FUNCTION = TRUE
_SUBQUERY_PRUNING_ENABLED = TRUE
_SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
_SUBQUERY_PRUNING_COST_FACTOR = 20
_LIKE_WITH_BIND_AS_EQUALITY = FALSE
_TABLE_SCAN_COST_PLUS_ONE = TRUE
_SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
_DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
_ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
_OPTIMIZER_COST_MODEL = CHOOSE
_GSETS_ALWAYS_USE_TEMPTABLES = FALSE
DB_FILE_MULTIBLOCK_READ_COUNT = 128
_NEW_SORT_COST_ESTIMATE = TRUE
_GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
_CPU_TO_IO = 0
_PRED_MOVE_AROUND = TRUE
BASE STATISTICAL INFORMATION
Table stats Table: SOC_LIST Alias: SOC
TOTAL :: CDN: 17584 NBLKS: 653 AVG_ROW_LEN: 260
-- Index stats
INDEX NAME: I_SNAP$_SOC_LIST COL#: 1
TOTAL :: LVLS: 1 #LB: 64 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 699
INDEX NAME: SOC_LIST_1IX COL#: 3
TOTAL :: LVLS: 1 #LB: 47 #DK: 17487 LB/K: 1 DB/K: 1 CLUF: 14065
_OPTIMIZER_PERCENT_PARALLEL = 0
SINGLE TABLE ACCESS PATH
TABLE: SOC_LIST ORIG CDN: 17584 ROUNDED CDN: 17584 CMPTD CDN: 17584
Access path: tsc Resc: 18 Resp: 18
****** trying bitmap/domain indexes ******
****** finished trying bitmap/domain indexes ******
BEST_CST: 18.00 PATH: 2 Degree: 1
OPTIMIZER STATISTICS AND COMPUTATIONS
GENERAL PLANS
Join order[1]: SOC_LIST[SOC]#0
Best so far: TABLE#: 0 CST: 18 CDN: 17584 BYTES: 0
Final - All Rows Plan:
JOIN ORDER: 1
CST: 18 CDN: 17584 RSC: 18 RSP: 18 BYTES: 0
IO-RSC: 18 IO-RSP: 18 CPU-RSC: 0 CPU-RSP: 0
BINDS #1:
bind 0: dty=96 mxl=32(01) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=32 offset=0
bfp=800003ffefea9490 bln=32 avl=01 flg=05
value="N"
EXEC #1:c=0,e=159,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017737385286
WAIT #1: nam='SQL*Net message to client' ela= 2 p1=1413697536 p2=1 p3=0
WAIT #1: nam='db file sequential read' ela= 9958 p1=586 p2=128001 p3=1
WAIT #1: nam='db file scattered read' ela= 619 p1=586 p2=128002 p3=4
WAIT #1: nam='db file sequential read' ela= 12880 p1=2535 p2=39498 p3=1
WAIT #1: nam='db file sequential read' ela= 39878 p1=2536 p2=68185 p3=1
WAIT #1: nam='db file sequential read' ela= 10240 p1=2536 p2=68520 p3=1
WAIT #1: nam='db file sequential read' ela= 15805 p1=2535 p2=45162 p3=1
WAIT #1: nam='db file sequential read' ela= 11733 p1=2535 p2=178335 p3=1
WAIT #1: nam='db file sequential read' ela= 11863 p1=2535 p2=178798 p3=1
WAIT #1: nam='db file sequential read' ela= 4886 p1=2535 p2=33834 p3=1
WAIT #1: nam='db file sequential read' ela= 12067 p1=2536 p2=60958 p3=1
WAIT #1: nam='db file sequential read' ela= 16496 p1=2535 p2=61232 p3=1
WAIT #1: nam='db file sequential read' ela= 8970 p1=2535 p2=50826 p3=1
WAIT #1: nam='db file sequential read' ela= 10940 p1=2536 p2=260451 p3=1
WAIT #1: nam='db file sequential read' ela= 8508 p1=2536 p2=261538 p3=1
WAIT #1: nam='db file scattered read' ela= 32000 p1=1613 p2=4622 p3=35
WAIT #1: nam='db file sequential read' ela= 1762 p1=2535 p2=178799 p3=1
WAIT #1: nam='db file sequential read' ela= 341 p1=2535 p2=61233 p3=1
WAIT #1: nam='db file scattered read' ela= 50494 p1=957 p2=230324 p3=35
WAIT #1: nam='db file scattered read' ela= 36716 p1=5 p2=588169 p3=35
WAIT #1: nam='db file scattered read' ela= 45241 p1=2326 p2=227427 p3=35
WAIT #1: nam='db file sequential read' ela= 11783 p1=2535 p2=68809 p3=1
WAIT #1: nam='db file scattered read' ela= 26720 p1=471 p2=102809 p3=35
WAIT #1: nam='db file scattered read' ela= 31074 p1=1496 p2=97015 p3=35
WAIT #1: nam='db file scattered read' ela= 39750 p1=586 p2=69452 p3=35
WAIT #1: nam='db file scattered read' ela= 30923 p1=1613 p2=8636 p3=35
WAIT #1: nam='db file scattered read' ela= 46328 p1=957 p2=67050 p3=35
WAIT #1: nam='db file scattered read' ela= 34570 p1=5 p2=362823 p3=35
WAIT #1: nam='db file scattered read' ela= 43343 p1=2326 p2=240311 p3=35
WAIT #1: nam='db file scattered read' ela= 30818 p1=471 p2=76417 p3=35
WAIT #1: nam='db file scattered read' ela= 19167 p1=1496 p2=480612 p3=35
WAIT #1: nam='db file scattered read' ela= 26405 p1=586 p2=193036 p3=35
WAIT #1: nam='db file scattered read' ela= 35374 p1=1613 p2=201565 p3=35
WAIT #1: nam='db file scattered read' ela= 14275 p1=957 p2=15804 p3=7
FETCH #1:c=190000,e=926019,p=552,cr=43429,cu=0,mis=0,r=1,dep=0,og=4,tim=3017738311433
WAIT #1: nam='SQL*Net message from client' ela= 2749 p1=1413697536 p2=1 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 2 p1=1413697536 p2=1 p3=0
FETCH #1:c=0,e=79,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=3017738314443
*** 2013-06-10 13:35:44.078
WAIT #1: nam='SQL*Net message from client' ela= 18650883 p1=1413697536 p2=1 p3=0
STAT #1 id=1 cnt=2 pid=0 pos=1 obj=0 op='UNION-ALL (cr=43429 r=552 w=0 time=926047 us)'
STAT #1 id=2 cnt=1 pid=1 pos=1 obj=0 op='SORT AGGREGATE (cr=43429 r=552 w=0 time=925989 us)'
STAT #1 id=3 cnt=157 pid=2 pos=1 obj=0 op='FILTER (cr=43429 r=552 w=0 time=925909 us)'
STAT #1 id=4 cnt=14296 pid=3 pos=1 obj=5769120 op='TABLE ACCESS FULL SOC_LIST (cr=541 r=537 w=0 time=579577 us)'
STAT #1 id=5 cnt=157 pid=3 pos=2 obj=0 op='PARTITION HASH SINGLE PARTITION: KEY KEY (cr=42888 r=15 w=0 time=285564 us)'
STAT #1 id=6 cnt=157 pid=5 pos=1 obj=5401812 op='INDEX UNIQUE SCAN ELIGIBILITY_RELATION_PK PARTITION: KEY KEY (cr=42888 r=15 w=0 time=265355 us)'
STAT #1 id=7 cnt=1 pid=1 pos=2 obj=0 op='SORT AGGREGATE (cr=0 r=0 w=0 time=4 us)'
STAT #1 id=8 cnt=0 pid=7 pos=1 obj=0 op='FILTER (cr=0 r=0 w=0 time=1 us)'
STAT #1 id=9 cnt=0 pid=8 pos=1 obj=5769120 op='TABLE ACCESS FULL SOC_LIST '
QUERY
select 'close cursor' from dual
=====================
PARSING IN CURSOR #1 len=31 dep=0 uid=33 oct=3 lid=33 tim=3017756967074 hv=3487944275 ad='48de6a60'
select 'close cursor' from dual
END OF STMT
PARSE #1:c=0,e=986,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017756967063
BINDS #1:
EXEC #1:c=0,e=47,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017756967278
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
FETCH #1:c=0,e=134,p=0,cr=3,cu=0,mis=0,r=1,dep=0,og=4,tim=3017756967515
WAIT #1: nam='SQL*Net message from client' ela= 2682 p1=1413697536 p2=1 p3=0
FETCH #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=3017756970325
WAIT #1: nam='SQL*Net message to client' ela= 1 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:35:57.804
WAIT #1: nam='SQL*Net message from client' ela= 13399621 p1=1413697536 p2=1 p3=0
=====================
PARSING IN CURSOR #3 len=116 dep=1 uid=0 oct=3 lid=0 tim=3017770371839 hv=431456802 ad='39fbad80'
select o.owner#,o.name,o.namespace,o.remoteowner,o.linkname,o.subname,o.dataobj#,o.flags from obj$ o where o.obj#=:1
END OF STMT
PARSE #3:c=0,e=1249,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=0,tim=3017770371828
BINDS #3:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
bfp=800003ffefea7a90 bln=22 avl=03 flg=05
value=172
EXEC #3:c=0,e=666,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=3017770372725
WAIT #3: nam='db file sequential read' ela= 10318 p1=1 p2=978 p3=1
WAIT #3: nam='db file sequential read' ela= 10292 p1=1 p2=318 p3=1
FETCH #3:c=10000,e=21071,p=2,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=3017770393830
STAT #1 id=1 cnt=1 pid=0 pos=1 obj=172 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=121 us)'
QUERY
ALTER SESSION SET EVENTS '10053 trace name context off'
=====================
PARSING IN CURSOR #1 len=55 dep=0 uid=33 oct=42 lid=33 tim=3017770394351 hv=3500836485 ad='3bed84c8'
ALTER SESSION SET EVENTS '10053 trace name context off'
END OF STMT
PARSE #1:c=0,e=227,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017770394344
BINDS #1:
EXEC #1:c=0,e=177,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017770394624
WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:36:13.139
WAIT #1: nam='SQL*Net message from client' ela= 14951473 p1=1413697536 p2=1 p3=0
=====================
PARSE ERROR #1:len=55 dep=0 uid=33 oct=42 lid=33 tim=3017785346905 err=911
ALTER SESSION SET EVENT=¿10046 trace name context off¿
WAIT #1: nam='SQL*Net break/reset to client' ela= 2 p1=1413697536 p2=1 p3=0
WAIT #1: nam='SQL*Net break/reset to client' ela= 2358 p1=1413697536 p2=0 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:36:53.497
WAIT #1: nam='SQL*Net message from client' ela= 39408861 p1=1413697536 p2=1 p3=0
=====================
PARSE ERROR #1:len=56 dep=0 uid=33 oct=42 lid=33 tim=3017824759339 err=911
ALTER SESSION SET EVENTS ¿10046 trace name context off¿
WAIT #1: nam='SQL*Net break/reset to client' ela= 4 p1=1413697536 p2=1 p3=0
WAIT #1: nam='SQL*Net break/reset to client' ela= 2342 p1=1413697536 p2=0 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:37:17.528
WAIT #1: nam='SQL*Net message from client' ela= 23463963 p1=1413697536 p2=1 p3=0
=====================
PARSE ERROR #1:len=57 dep=0 uid=33 oct=42 lid=33 tim=3017848226738 err=911
ALTER SESSION SET EVENTS '10043 trace name context off';
WAIT #1: nam='SQL*Net break/reset to client' ela= 1 p1=1413697536 p2=1 p3=0
WAIT #1: nam='SQL*Net break/reset to client' ela= 2305 p1=1413697536 p2=0 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
WAIT #1: nam='SQL*Net message from client' ela= 9416071 p1=1413697536 p2=1 p3=0
=====================
PARSING IN CURSOR #1 len=55 dep=0 uid=33 oct=42 lid=33 tim=3017857646552 hv=2635134026 ad='4b92b7e8'
ALTER SESSION SET EVENTS '10043 trace name context off'
END OF STMT
PARSE #1:c=0,e=616,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017857646541
BINDS #1:
EXEC #1:c=0,e=285,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017857647009
WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
*** 2013-06-10 13:58:46.112
WAIT #1: nam='SQL*Net message from client' ela= 1248974802 p1=1413697536 p2=1 p3=0
XCTEND rlbk=0, rd_only=1 -
Query taking long time for EXTRACTING the data more than 24 hours
Hi ,
Query taking long time for EXTRACTING the data more than 24 hours please find the query and explain plan details below even indexes avilable on table's goe's to FULL TABLE SCAN. please suggest me.......
SQL> explain plan for select a.account_id,round(a.account_balance,2) account_balance,
2 nvl(ah.invoice_id,ah.adjustment_id) transaction_id,
to_char(ah.effective_start_date,'DD-MON-YYYY') transaction_date,
to_char(nvl(i.payment_due_date,
to_date('30-12-9999','dd-mm-yyyy')),'DD-MON-YYYY')
due_date, ah.current_balance-ah.previous_balance amount,
decode(ah.invoice_id,null,'A','I') transaction_type
3 4 5 6 7 8 from account a,account_history ah,invoice i_+
where a.account_id=ah.account_id
and a.account_type_id=1000002
and round(a.account_balance,2) > 0
and (ah.invoice_id is not null or ah.adjustment_id is not null)
and ah.CURRENT_BALANCE > ah.previous_balance
and ah.invoice_id=i.invoice_id(+)
AND a.account_balance > 0
order by a.account_id,ah.effective_start_date desc; 9 10 11 12 13 14 15 16
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
| 0 | SELECT STATEMENT | | 544K| 30M| | 693K (20)|
| 1 | SORT ORDER BY | | 544K| 30M| 75M| 693K (20)|
|* 2 | HASH JOIN | | 544K| 30M| | 689K (20)|
|* 3 | TABLE ACCESS FULL | ACCOUNT | 20080 | 294K| | 6220 (18)|
|* 4 | HASH JOIN OUTER | | 131M| 5532M| 5155M| 678K (20)|
|* 5 | TABLE ACCESS FULL| ACCOUNT_HISTORY | 131M| 3646M| | 197K (25)|
| 6 | TABLE ACCESS FULL| INVOICE | 262M| 3758M| | 306K (18)|
Predicate Information (identified by operation id):
2 - access("A"."ACCOUNT_ID"="AH"."ACCOUNT_ID")
3 - filter("A"."ACCOUNT_TYPE_ID"=1000002 AND "A"."ACCOUNT_BALANCE">0 AND
ROUND("A"."ACCOUNT_BALANCE",2)>0)
4 - access("AH"."INVOICE_ID"="I"."INVOICE_ID"(+))
5 - filter("AH"."CURRENT_BALANCE">"AH"."PREVIOUS_BALANCE" AND ("AH"."INVOICE_ID"
IS NOT NULL OR "AH"."ADJUSTMENT_ID" IS NOT NULL))
22 rows selected.
Index Details:+_
SQL> select INDEX_OWNER,INDEX_NAME,COLUMN_NAME,TABLE_NAME from dba_ind_columns where
2 table_name in ('INVOICE','ACCOUNT','ACCOUNT_HISTORY') order by 4;
INDEX_OWNER INDEX_NAME COLUMN_NAME TABLE_NAME
OPS$SVM_SRV4 P_ACCOUNT ACCOUNT_ID ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT_NAME ACCOUNT_NAME ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT CUSTOMER_NODE_ID ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT ACCOUNT_TYPE_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_ACCOUNT_TYPE ACCOUNT_TYPE_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_INVOICE INVOICE_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_PREVIOUS_INVOICE PREVIOUS_INVOICE_ID ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_NAME ACCOUNT
OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_ID ACCOUNT
OPS$SVM_SRV4 I_LAST_MODIFIED_ACCOUNT LAST_MODIFIED ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_INVOICE_ACCOUNT INVOICE_ACCOUNT_ID ACCOUNT
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT ACCOUNT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT SEQNR ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_INVOICE INVOICE_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV INVOICE_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA CURRENT_BALANCE ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA INVOICE_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ADJUSTMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ACCOUNT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_LMOD LAST_MODIFIED ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV ADJUSTMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_PAYMENT PAYMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADJUSTMENT ADJUSTMENT_ID ACCOUNT_HISTORY
OPS$SVM_SRV4 I_ACCOUNT_HISTORY_APPLIED_DT APPLIED_DATE ACCOUNT_HISTORY
OPS$SVM_SRV4 P_INVOICE INVOICE_ID INVOICE
OPS$SVM_SRV4 U_INVOICE CUSTOMER_INVOICE_STR INVOICE
OPS$SVM_SRV4 I_LAST_MODIFIED_INVOICE LAST_MODIFIED INVOICE
OPS$SVM_SRV4 U_INVOICE_ACCOUNT ACCOUNT_ID INVOICE
OPS$SVM_SRV4 U_INVOICE_ACCOUNT BILL_RUN_ID INVOICE
OPS$SVM_SRV4 I_INVOICE_BILL_RUN BILL_RUN_ID INVOICE
OPS$SVM_SRV4 I_INVOICE_INVOICE_TYPE INVOICE_TYPE_ID INVOICE
OPS$SVM_SRV4 I_INVOICE_CUSTOMER_NODE CUSTOMER_NODE_ID INVOICE
32 rows selected.
Regards,
Bathula
Oracle-DBAI have some suggestions. But first, you realize that you have some redundant indexes, right? You have an index on account(account_name) and also account(account_name, account_id), and also account_history(invoice_id) and account_history(invoice_id, adjustment_id). No matter, I will suggest some new composite indexes.
Also, you do not need two lines for these conditions:
and round(a.account_balance, 2) > 0
AND a.account_balance > 0
You can just use: and a.account_balance >= 0.005
So the formatted query isselect a.account_id,
round(a.account_balance, 2) account_balance,
nvl(ah.invoice_id, ah.adjustment_id) transaction_id,
to_char(ah.effective_start_date, 'DD-MON-YYYY') transaction_date,
to_char(nvl(i.payment_due_date, to_date('30-12-9999', 'dd-mm-yyyy')),
'DD-MON-YYYY') due_date,
ah.current_balance - ah.previous_balance amount,
decode(ah.invoice_id, null, 'A', 'I') transaction_type
from account a, account_history ah, invoice i
where a.account_id = ah.account_id
and a.account_type_id = 1000002
and (ah.invoice_id is not null or ah.adjustment_id is not null)
and ah.CURRENT_BALANCE > ah.previous_balance
and ah.invoice_id = i.invoice_id(+)
AND a.account_balance >= .005
order by a.account_id, ah.effective_start_date desc;You will probably want to select:
1. From ACCOUNT first (your smaller table), for which you supply a literal on account_type_id. That should limit the accounts retrieved from ACCOUNT_HISTORY
2. From ACCOUNT_HISTORY. We want to limit the records as much as possible on this table because of the outer join.
3. INVOICE we want to access last because it seems to be least restricted, it is the biggest, and it has the outer join condition so it will manufacture rows to match as many rows as come back from account_history.
Try the query above after creating the following composite indexes. The order of the columns is important:create index account_composite_i on account(account_type_id, account_balance, account_id);
create index acct_history_comp_i on account_history(account_id, invoice_id, adjustment_id, current_balance, previous_balance, effective_start_date);
create index invoice_composite_i on invoice(invoice_id, payment_due_date);All the columns used in the where clause will be indexed, in a logical order suited to the needs of the query. Plus each selected column is indexed as well so that we should not need to touch the tables at all to satisfy the query.
Try the query after creating these indexes.
A final suggestion is to try larger sort and hash area sizes and a manual workarea policy.alter session set workarea_size_policy = manual;
alter session set sort_area_size = 2147483647;
alter session set hash_area_size = 2147483647; -
Problem in sql query because of order by clause
Hi All,
I am facing a one problem in my one sql query.I am using Oracle 10gR2.
Query is given below:
SELECT t1.ename
FROM T1, T2
WHERE T1.EMPNO = 1234
AND T1.ACCOUNTNO = T2.ACCOUNTNO
AND T1.SEQ = T2.SEQ
ORDER BY T2.SEQThe Plan of the query is :
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 218 | 11716 (1)| 00:00:41 |
|* 1 | TABLE ACCESS BY INDEX ROWID | T1 | 1 | 89 | 1 (0)| 00:00:01 |
| 2 | NESTED LOOPS | | 2 | 218 | 11716 (1)| 00:00:41 |
|* 3 | TABLE ACCESS BY INDEX ROWID| T2 | 2 | 40 | 11715 (1)| 00:00:41 |
| 4 | INDEX FULL SCAN | PK_T2_SEQ | 58752 | | 122 (5)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | FK_ACCOUNTNO | 3 | | 0 (0)| 00:00:01 |
----------------------------------------------------------------------------------------------------Now i want to reduce the time of this query.
If i am removing Order by clause from query than performance of the query is totally perfect but with order by clause its taking a time.
I have already set SORT_AREA_SIZE but still nothing is improving.
Welcome and thanks for your suggestions.
Thanks,
Edited by: BluShadow on 23-Jun-2011 07:55
added {noformat}{noformat} tags and formatted explain plan to make it readable. Please see {message:id=9360002} for details on how to post code and dataHi,
There are a couple of things I do not understand.
1. Why don't you put {noformat}{noformat} around your code, it makes it so much easier to read, especially your explain plan
2. You claim that the ORDER BY is problematic compared to no order by. Then why do you choose to post only one plan?
3. It is hard to understand how your tables relate, and which indexes you have and which you don't.
- PK_T2_SEQ, does this mean that SEQ alone is primary key of T2?
- If SEQ is primary key of T2, why do you join on accountno, seq and not just seq?
- If SEQ is primary key of T2 one of the tables is denormalized.
4. FK_ACCOUNTNO, is this an index on accountno, alone?
- Or is this AccountNo, Seq?
5. Is there no index on T1.EMPNO?
Above could of course just be a case of my not understanding the names of your indexes.
So, here are my guesses:
Above plan is for the ORDER BY query. That means the optimizer, has chosen to full scan PK_T2_SEQ, since data is then read according to the ORDER BY.
(This could be a bad choice)I
You could try and order by t1.seq, instead. Result should be the same.
Regards
Peter -
How to set sort_area_size
hello
I’m dealing with a query in which almost 100 inner joins involved. I will post query if needed. Basically it is insert statement but I run only it selection part it take 40 minutes. When I run ASH REPORT during execution I found direct path read temp, direct path write temp in top user event , buffer busy waits, control file sequential read,. I’m using 11g with automatic memory management 9Gb assign to memeory_target, and memeory_max_target,. My workarea_size_policy is auto and sort_area_size
is default 64k. all sory take palce in temp almost 10 to 15 GB temp use when I executes this select statement. I know it is very difficult to sorry all in memory but it should not done all in temp. I wanted to change workarea_size_policyto manual and set sort_area_size. What would be the size of sort_area_size ? I was reading a BOOK of Jonathan Lewis COST based oracle fundamental in which he told us the way to sizing the sort_area_size. But he did not show how he calculated this size and he did only for one table in my case five table join with one table. How I calculate size
Here is John Example
After using the dbms_stats.gather_table_stats procedure, I can check view user_tables
to confirm that the table fills 2,753 blocks, and holds 1,048,576 rows with an avg_row_len of
14 bytes, and that the avg_col_len for column sortcode is 7 bytes (the v2, v3 columns are there
simply to avoid the possibility of some funny boundary conditions appearing). These 7 bytes
include the 1 byte that holds the column length itself, so we can work out that the total volume
of data sorted must be 6MB, and that my memory allocation of 1MB is not going to be sufficient
for an in-memory (optimal) sort.Oracle Studnet wrote:
I know it is very difficult to sorry all in memory but it should not done all in temp. I wanted to change workarea_size_policyto manual and set sort_area_size. What would be the size of sort_area_sizeIn 11g you can check for a long running query in V$SQL_PLAN_MONITOR how much memory each workarea execution consumed (just to check if your automatic workarea_size_policy seems to be an issue).
You can run your query with DBMS_XPLAN.DISPLAY_CURSOR get the estimated memory requirements for optimal and single pass executions in the columns "OMem", "1Mem" and "Used-Mem" of the DISPLAY_CURSOR output.
More information about using the DISPLAY_CURSOR function properly can be found here:
http://jonathanlewis.wordpress.com/2006/11/09/dbms_xplan-in-10g/
http://structureddata.org/2007/11/21/troubleshooting-bad-execution-plans/
http://rwijk.blogspot.com/2008/03/dbmsxplandisplaycursor.html
Christian Antognini points out that the TEMPSEG_SIZE information of DISPLAY_CURSOR is using the wrong units: http://antognini.ch/2009/05/wrong-information-about-temporary-space-usage/
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
How to increase the size of sort_area_size
How to increase the size of sort_area_size and what size should be according to the PROD database
Thanksuser10869960 wrote:
Hi,
Many Thanks Charles
Oracle does not recommend using the SORT_AREA_SIZE parameter unless the instance is configured with the shared server option. Oracle recommends that you enable automatic sizing of SQL working areas by setting PGA_AGGREGATE_TARGET instead. SORT_AREA_SIZE is retained for backward compatibility."
--How can i know the instance is configured with the shared server option or not?This might be a tough question to answer. A shared server configuration may be enabled, but the clients may still connect using dedicated sessions, in which case PGA_AGGREGATE_TARGET would still apply.
From
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm
V$SESSION includes a column named SERVER which will contain one of the following for each of the sessions: DEDICATED, SHARED, PSEUDO, or NONE. As a quick check, you could query V$SESSION to see if any sessions are connected using a shared server connection.
From:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/manproc.htm
There are several parameters which are used to configure shared server support, as well as several views to monitor shared server.
As Robert mentioned, when the WORKAREA_SIZE_POLICY is set to AUTO, the SORT_AREA_SIZE setting is not used, unless a shared server configuration is in use.
--What default value is WORKAREA_SIZE_POLICY and SORT_AREA_SIZE ?From:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams157.htm
"Setting PGA_AGGREGATE_TARGET to a nonzero value has the effect of automatically setting the WORKAREA_SIZE_POLICY parameter to AUTO. This means that SQL working areas used by memory-intensive SQL operators (such as sort, group-by, hash-join, bitmap merge, and bitmap create) will be automatically sized. A nonzero value for this parameter is the default since, unless you specify otherwise, Oracle sets it to 20% of the SGA or 10 MB, whichever is greater."
Actually I am facing performence issue since long time till now i did not get the solution even i have raised SRs but i could not.When the issue occur system seems hang.what i monitored whenever hdisk0 and hdisk1 use 100% the issue occur.
Regards,
SajidWhen you say that you have had a performance issue for a long time, is it a performance problem faced by a single SQL statement, a single user, a single application, or everything on the server? If you are able to identify a single user, or SQL statement that is experiencing poor performance, I suggest starting with a 10046 trace at level 8 (wait events) or level 12 (wait events and bind variables) to determine why the execution appears to be slow. If you have not yet determined a specific user or SQL statement that is experiencing performance problems, you might start with either a Statspack Report or an AWR Report (AWR requires a separate license).
If you believe that temp tablespace usage may be a contributing factor to the performance problem, you may want to periodically run this query, which will indicate currently in use temp tablespace usage:
{code}
SELECT /*+ ORDERED */
TU.USERNAME,
S.SID,
S.SERIAL#,
S.SQL_ID,
S.SQL_ADDRESS,
TU.SEGTYPE,
TU.EXTENTS,
TU.BLOCKS,
SQL.SQL_TEXT
FROM
V$TEMPSEG_USAGE TU,
V$SESSION S,
V$SQL SQL
WHERE
TU.SESSION_ADDR=S.SADDR
AND TU.SESSION_NUM=S.SERIAL#
AND S.SQL_ID=SQL.SQL_ID
AND S.SQL_ADDRESS=SQL.ADDRESS;
{code}
The SID and SERIAL# returned by the above could then be used to enable a 10046 trace for a session. The SQL_ID (and CHILD_NUMBER from V$SESSION in recent releases) could be used with DBMS_XPLAN.DISPLAY_CURSOR to return the execution plan for the SQL statement.
You could also take a look in V$SQL_WORKAREA_ACTIVE to determine which, if any, SQL statement are resulting in single-pass, or multi-pass executions, which both access the temp tablespace.
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
Identical query, unusable performance in one environment - please help
We are attempting to upgrade from 10.2.0.4 to 11.2.0.2 but one of our reporting queries is completely struggling (30 seconds in our current environment, 4000 seconds in our upgraded environment).
Note that the caveat is that it will be very difficult for me to modify the SQL (its coming from a different IT group, and their position is that it should not have to be modified given that it runs so well in the current production environment).
The query is exactly the same in both environments, and carries the same SQL_ID, but explain plans are different.
The environment in which the query works is version 10.2.0.4, and elapsed time per the trace is 30.15 seconds, 841 rows returned.
The new environment is 11.2.0.2, elapsed time is 4035 seconds, 841 rows returned.
The environments are comparable in terms of CPU/Memory/IO (both are writing to NFS mounts on our NetApp)
SGA_MAX/TARGET and PGA_AGGREGATE_TARGET are the same in both environments, as are HASH_AREA_SIZE and SORT_AREA_SIZE.
Underlying table data is identical, and all indexes are the same in both environments. Stats have been gathered and this behavior has persisted through multiple reboots of the databases.
I've run traces on the statements in both environments and the performance difference appears to be due to direct path read/write temp:
The SQL
SELECT DISTINCT
a.emplid,
a.name,
rds.sa_get_stdnt_email_fn (a.emplid),
a.req_term,
a.req_term_ldesc,
CASE
WHEN (a.req_acad_plan = 'PKINXXXBBS' AND a.cum_gpa >= d.gpa)
THEN
NVL (c.num_met, 0) + 1
WHEN (b.gpa >= d.gpa AND a.req_acad_plan <> 'PKINXXXBBS')
THEN
NVL (c.num_met, 0) + 1
ELSE
NVL (c.num_met, 0)
END
AS "Requirement Status",
a.cum_total_passed AS "Cumulative Units",
a.admit_term,
a.admit_term_ldesc,
a.acad_plan,
a.acad_plan_ldesc,
a.academic_level,
a.academic_level_ldesc,
TO_CHAR (a.rpt_date, 'MM/DD/YYYY') AS rpt_date,
TO_CHAR (NVL (b.gpa, 0), '0.000') AS gpa,
TO_CHAR (NVL (a.cum_gpa, 0), '0.000') AS cum_gpa
FROM sa.rec_sm_stdnt_deg_completion a,
( SELECT DISTINCT
CASE
WHEN SUM (b_sub.units_earned) = 0 THEN 0
ELSE SUM (b_sub.grade_points) / SUM (b_sub.units_earned)
END
AS gpa,
b_sub.emplid,
b_sub.acad_career,
b_sub.acad_plan,
b_sub.req_acad_plan,
b_sub.req_term,
b_sub.academic_level,
b_sub.rqrmnt_group
FROM sa.rec_sm_stdnt_deg_completion b_sub,
hrsa_extr.ps_rq_grp_tbl g3,
hrsa_extr.ps_rq_main_tbl m3
WHERE b_sub.req_acad_plan IS NOT NULL
AND b_sub.acad_career = 'UGRD'
AND b_sub.acad_prog = 'UBACH'
AND b_sub.acad_plan = b_sub.req_acad_plan
AND b_sub.grade <> 'IP'
AND b_sub.impact_flag = 'Y'
AND g3.effdt =
(SELECT MAX (g3_ed.effdt)
FROM hrsa_extr.ps_rq_grp_tbl g3_ed
WHERE g3_ed.rqrmnt_group = g3.rqrmnt_group
AND g3_ed.effdt <= b_sub.req_term_begin_date)
AND g3.rqrmnt_group = b_sub.rqrmnt_group
AND m3.effdt =
(SELECT MAX (m3_ed.effdt)
FROM hrsa_extr.ps_rq_main_tbl m3_ed
WHERE m3_ed.requirement = m3.requirement
AND m3_ed.effdt <= b_sub.req_term_begin_date)
AND m3.requirement = b_sub.requirement
GROUP BY b_sub.emplid,
b_sub.acad_career,
b_sub.acad_plan,
b_sub.req_acad_plan,
b_sub.req_term,
b_sub.academic_level,
b_sub.rqrmnt_group) b,
( SELECT c_sub.emplid,
c_sub.acad_career,
c_sub.acad_plan,
c_sub.req_acad_plan,
c_sub.req_term,
c_sub.academic_level,
c_sub.rqrmnt_group,
COUNT (*) AS num_met
FROM sa.rec_sm_stdnt_deg_completion c_sub,
hrsa_extr.ps_rq_grp_tbl g2,
hrsa_extr.ps_rq_main_tbl m2
WHERE c_sub.rqrmnt_line_status = 'COMP'
AND c_sub.grade <> 'IP'
AND c_sub.impact_flag = 'Y'
AND c_sub.acad_career = 'UGRD'
AND c_sub.acad_prog = 'UBACH'
AND c_sub.acad_plan = c_sub.req_acad_plan
AND g2.effdt =
(SELECT MAX (g2_ed.effdt)
FROM hrsa_extr.ps_rq_grp_tbl g2_ed
WHERE g2_ed.rqrmnt_group = g2.rqrmnt_group
AND g2_ed.effdt <= c_sub.req_term_begin_date)
AND g2.rqrmnt_group = c_sub.rqrmnt_group
AND m2.effdt =
(SELECT MAX (m2_ed.effdt)
FROM hrsa_extr.ps_rq_main_tbl m2_ed
WHERE m2_ed.requirement = m2.requirement
AND m2_ed.effdt <= c_sub.req_term_begin_date)
AND m2.requirement = c_sub.requirement
GROUP BY c_sub.emplid,
c_sub.acad_career,
c_sub.acad_plan,
c_sub.req_acad_plan,
c_sub.req_term,
c_sub.academic_level,
c_sub.rqrmnt_group) c,
hrsa_extr.ps_smo_rdr_imp_pln d,
hrsa_extr.ps_rq_grp_tbl g,
hrsa_extr.ps_rq_main_tbl m
WHERE a.acad_career = 'UGRD'
AND a.acad_prog = 'UBACH'
AND a.req_acad_plan IN (N'NUPPXXXBBS', N'NURPBASBBS', N'NURPXXXBBS')
AND a.academic_level IN (N'10', N'20', N'30', N'40', N'50', N'GR')
AND a.acad_plan = a.req_acad_plan
AND a.impact_flag = 'Y'
AND g.effdt =
(SELECT MAX (g_ed.effdt)
FROM hrsa_extr.ps_rq_grp_tbl g_ed
WHERE g_ed.rqrmnt_group = g.rqrmnt_group
AND g_ed.effdt <= a.req_term_begin_date)
AND g.rqrmnt_group = a.rqrmnt_group
AND m.effdt =
(SELECT MAX (m_ed.effdt)
FROM hrsa_extr.ps_rq_main_tbl m_ed
WHERE m_ed.requirement = m.requirement
AND m_ed.effdt <= a.req_term_begin_date)
AND m.requirement = a.requirement
AND a.emplid = b.emplid(+)
AND a.acad_career = b.acad_career(+)
AND a.acad_plan = b.acad_plan(+)
AND a.req_acad_plan = b.req_acad_plan(+)
AND a.academic_level = b.academic_level(+)
AND a.req_term = b.req_term(+)
AND a.rqrmnt_group = b.rqrmnt_group(+)
AND a.emplid = c.emplid(+)
AND a.acad_career = c.acad_career(+)
AND a.acad_plan = c.acad_plan(+)
AND a.req_acad_plan = c.req_acad_plan(+)
AND a.academic_level = c.academic_level(+)
AND a.req_term = c.req_term(+)
AND a.rqrmnt_group = c.rqrmnt_group(+)
AND d.acad_plan = a.req_acad_plan
ORDER BY 6 DESC, 2 ASC;New environment (11.2.0.2), takes 4000 seconds according to tkprof
Explain plan
PLAN_TABLE_OUTPUT
Plan hash value: 4117596694
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 314 | 15231 (1)| 00:03:03 |
| 1 | SORT UNIQUE | | 1 | 314 | 15230 (1)| 00:03:03 |
| 2 | NESTED LOOPS OUTER | | 1 | 314 | 15227 (1)| 00:03:03 |
| 3 | NESTED LOOPS OUTER | | 1 | 285 | 15216 (1)| 00:03:03 |
| 4 | NESTED LOOPS | | 1 | 256 | 15205 (1)| 00:03:03 |
| 5 | NESTED LOOPS | | 1 | 241 | 15204 (1)| 00:03:03 |
| 6 | NESTED LOOPS | | 1 | 223 | 15203 (1)| 00:03:03 |
| 7 | NESTED LOOPS | | 17 | 731 | 15186 (1)| 00:03:03 |
| 8 | VIEW | VW_SQ_3 | 998 | 27944 | 15186 (1)| 00:03:03 |
| 9 | HASH GROUP BY | | 998 | 62874 | 15186 (1)| 00:03:03 |
| 10 | MERGE JOIN | | 29060 | 1787K| 15184 (1)| 00:03:03 |
| 11 | SORT JOIN | | 26 | 1248 | 15180 (1)| 00:03:03 |
| 12 | TABLE ACCESS BY INDEX ROWID | REC_SM_STDNT_DEG_COMPLETION | 26 | 1248 | 15179 (1)| 00:03:03 |
|* 13 | INDEX SKIP SCAN | REC0SM_STDNT_DEG_IDX | 26 | | 15168 (1)| 00:03:03 |
|* 14 | SORT JOIN | | 1217 | 18255 | 4 (25)| 00:00:01 |
| 15 | INDEX FAST FULL SCAN | PS3RQ_GRP_TBL | 1217 | 18255 | 3 (0)| 00:00:01 |
|* 16 | INDEX UNIQUE SCAN | PS_RQ_GRP_TBL | 1 | 15 | 0 (0)| 00:00:01 |
|* 17 | TABLE ACCESS BY USER ROWID | REC_SM_STDNT_DEG_COMPLETION | 1 | 180 | 1 (0)| 00:00:01 |
|* 18 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
| 19 | SORT AGGREGATE | | 1 | 18 | | |
| 20 | FIRST ROW | | 1 | 18 | 2 (0)| 00:00:01 |
|* 21 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_MAIN_TBL | 1 | 18 | 2 (0)| 00:00:01 |
|* 22 | INDEX FULL SCAN | PS0SMO_RDR_IMP_PLN | 1 | 15 | 1 (0)| 00:00:01 |
|* 23 | VIEW PUSHED PREDICATE | | 1 | 29 | 11 (19)| 00:00:01 |
| 24 | SORT GROUP BY | | 1 | 52 | 11 (19)| 00:00:01 |
| 25 | VIEW | VM_NWVW_5 | 1 | 52 | 10 (10)| 00:00:01 |
|* 26 | FILTER | | | | | |
| 27 | SORT GROUP BY | | 1 | 165 | 10 (10)| 00:00:01 |
|* 28 | FILTER | | | | | |
| 29 | NESTED LOOPS | | 1 | 165 | 7 (0)| 00:00:01 |
| 30 | NESTED LOOPS | | 1 | 147 | 6 (0)| 00:00:01 |
| 31 | NESTED LOOPS | | 1 | 117 | 5 (0)| 00:00:01 |
|* 32 | TABLE ACCESS BY INDEX ROWID | REC_SM_STDNT_DEG_COMPLETION | 1 | 90 | 4 (0)| 00:00:01 |
|* 33 | INDEX RANGE SCAN | REC1SM_STDNT_DEG_IDX | 1 | | 3 (0)| 00:00:01 |
|* 34 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 1 (0)| 00:00:01 |
| 35 | SORT AGGREGATE | | 1 | 15 | | |
| 36 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 37 | INDEX RANGE SCAN (MIN/MAX)| PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
|* 38 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 30 | 1 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
|* 40 | VIEW PUSHED PREDICATE | | 1 | 29 | 11 (19)| 00:00:01 |
| 41 | SORT GROUP BY | | 1 | 32 | 11 (19)| 00:00:01 |
| 42 | VIEW | VM_NWVW_4 | 1 | 32 | 10 (10)| 00:00:01 |
|* 43 | FILTER | | | | | |
| 44 | SORT GROUP BY | | 1 | 166 | 10 (10)| 00:00:01 |
|* 45 | FILTER | | | | | |
|* 46 | FILTER | | | | | |
| 47 | NESTED LOOPS | | 1 | 166 | 7 (0)| 00:00:01 |
| 48 | NESTED LOOPS | | 1 | 148 | 6 (0)| 00:00:01 |
| 49 | NESTED LOOPS | | 1 | 118 | 5 (0)| 00:00:01 |
|* 50 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 2 (0)| 00:00:01 |
|* 51 | TABLE ACCESS BY INDEX ROWID | REC_SM_STDNT_DEG_COMPLETION | 1 | 91 | 3 (0)| 00:00:01 |
|* 52 | INDEX RANGE SCAN | REC1SM_STDNT_DEG_IDX | 1 | | 2 (0)| 00:00:01 |
|* 53 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 30 | 1 (0)| 00:00:01 |
|* 54 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
| 55 | SORT AGGREGATE | | 1 | 15 | | |
| 56 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 57 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
call count cpu elapsed disk query current rows
Parse 1 6.59 6.66 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 1521.36 4028.91 2256624 240053408 0 841
total 4 1527.95 4035.57 2256624 240053408 0 841
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
Disk file operations I/O 3 0.07 0.11
db file sequential read 10829 0.12 16.62
direct path write temp 72445 0.30 293.71
direct path read temp 72445 0.58 2234.14
asynch descriptor resize 22 0.00 0.00
SQL*Net more data to client 9 0.00 0.00
SQL*Net message from client 2 0.84 1.25
********************************************************************************Current production (10.2.0.4), takes 30 seconds
PLAN_TABLE_OUTPUT
Plan hash value: 2178773127
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 331 | 89446 (2)| 00:17:54 |
| 1 | SORT UNIQUE | | 1 | 331 | 89445 (2)| 00:17:54 |
| 2 | NESTED LOOPS | | 1 | 331 | 89440 (2)| 00:17:54 |
| 3 | NESTED LOOPS | | 1 | 316 | 89439 (2)| 00:17:54 |
|* 4 | HASH JOIN OUTER | | 1 | 298 | 89438 (2)| 00:17:54 |
|* 5 | HASH JOIN OUTER | | 1 | 240 | 59625 (2)| 00:11:56 |
| 6 | NESTED LOOPS | | 1 | 182 | 29815 (2)| 00:05:58 |
|* 7 | TABLE ACCESS FULL | REC_SM_STDNT_DEG_COMPLETION | 1 | 167 | 29814 (2)| 00:05:58 |
|* 8 | INDEX FULL SCAN | PS0SMO_RDR_IMP_PLN | 1 | 15 | 1 (0)| 00:00:01 |
| 9 | VIEW | | 1 | 58 | 29809 (2)| 00:05:58 |
| 10 | HASH GROUP BY | | 1 | 71 | 29809 (2)| 00:05:58 |
| 11 | VIEW | | 1 | 71 | 29809 (2)| 00:05:58 |
|* 12 | FILTER | | | | | |
| 13 | HASH GROUP BY | | 1 | 198 | 29809 (2)| 00:05:58 |
| 14 | NESTED LOOPS | | 1 | 198 | 29806 (2)| 00:05:58 |
|* 15 | HASH JOIN | | 1 | 171 | 29805 (2)| 00:05:58 |
|* 16 | HASH JOIN | | 4 | 572 | 29802 (2)| 00:05:58 |
|* 17 | TABLE ACCESS FULL | REC_SM_STDNT_DEG_COMPLETION | 4 | 452 | 29798 (2)| 00:05:58 |
| 18 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 31050 | 3 (0)| 00:00:01 |
| 19 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 28980 | 3 (0)| 00:00:01 |
|* 20 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 1 (0)| 00:00:01 |
| 21 | SORT AGGREGATE | | 1 | 15 | | |
| 22 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 23 | INDEX RANGE SCAN (MIN/MAX)| PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
| 24 | VIEW | | 1 | 58 | 29813 (2)| 00:05:58 |
| 25 | HASH GROUP BY | | 1 | 45 | 29813 (2)| 00:05:58 |
| 26 | VIEW | | 1 | 45 | 29813 (2)| 00:05:58 |
|* 27 | FILTER | | | | | |
| 28 | HASH GROUP BY | | 1 | 199 | 29813 (2)| 00:05:58 |
| 29 | NESTED LOOPS | | 1 | 199 | 29810 (2)| 00:05:58 |
|* 30 | HASH JOIN | | 1 | 172 | 29809 (2)| 00:05:58 |
|* 31 | HASH JOIN | | 8 | 1152 | 29805 (2)| 00:05:58 |
|* 32 | TABLE ACCESS FULL | REC_SM_STDNT_DEG_COMPLETION | 7 | 798 | 29802 (2)| 00:05:58 |
| 33 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 31050 | 3 (0)| 00:00:01 |
| 34 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 28980 | 3 (0)| 00:00:01 |
|* 35 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 1 (0)| 00:00:01 |
| 36 | SORT AGGREGATE | | 1 | 15 | | |
| 37 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 38 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
| 40 | SORT AGGREGATE | | 1 | 18 | | |
| 41 | FIRST ROW | | 1 | 18 | 2 (0)| 00:00:01 |
|* 42 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_MAIN_TBL | 1 | 18 | 2 (0)| 00:00:01 |
|* 43 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 15 | 1 (0)| 00:00:01 |
| 44 | SORT AGGREGATE | | 1 | 15 | | |
| 45 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 46 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
call count cpu elapsed disk query current rows
Parse 1 1.49 1.51 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 18.25 28.63 463672 932215 0 836
total 4 19.75 30.15 463672 932215 0 836
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
db file scattered read 14262 0.31 13.13
latch: shared pool 1 0.01 0.01
db file sequential read 7 0.00 0.00
direct path write temp 493 0.00 0.00
direct path read temp 493 0.00 0.00
SQL*Net more data to client 40 0.00 0.00
SQL*Net message from client 2 0.83 1.23
********************************************************************************Edited by: ngilbert on Jun 26, 2012 4:40 PM
Edited by: ngilbert on Jun 26, 2012 4:41 PMSorry - you're right, no significance, very new to this - based on this article i assumed the hash algorithm to get SQL_ID from SQL text would be the same across different instances:
http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/
Trying again:
Current environment, 10.2.0.4, 30 seconds for all rows, explain plan with predicate information
PLAN_TABLE_OUTPUT
Plan hash value: 2178773127
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 331 | 89446 (2)| 00:17:54 |
| 1 | SORT UNIQUE | | 1 | 331 | 89445 (2)| 00:17:54 |
| 2 | NESTED LOOPS | | 1 | 331 | 89440 (2)| 00:17:54 |
| 3 | NESTED LOOPS | | 1 | 316 | 89439 (2)| 00:17:54 |
|* 4 | HASH JOIN OUTER | | 1 | 298 | 89438 (2)| 00:17:54 |
|* 5 | HASH JOIN OUTER | | 1 | 240 | 59625 (2)| 00:11:56 |
| 6 | NESTED LOOPS | | 1 | 182 | 29815 (2)| 00:05:58 |
|* 7 | TABLE ACCESS FULL | REC_SM_STDNT_DEG_COMPLETION | 1 | 167 | 29814 (2)| 00:05:58 |
|* 8 | INDEX FULL SCAN | PS0SMO_RDR_IMP_PLN | 1 | 15 | 1 (0)| 00:00:01 |
| 9 | VIEW | | 1 | 58 | 29809 (2)| 00:05:58 |
| 10 | HASH GROUP BY | | 1 | 71 | 29809 (2)| 00:05:58 |
| 11 | VIEW | | 1 | 71 | 29809 (2)| 00:05:58 |
|* 12 | FILTER | | | | | |
| 13 | HASH GROUP BY | | 1 | 198 | 29809 (2)| 00:05:58 |
| 14 | NESTED LOOPS | | 1 | 198 | 29806 (2)| 00:05:58 |
|* 15 | HASH JOIN | | 1 | 171 | 29805 (2)| 00:05:58 |
|* 16 | HASH JOIN | | 4 | 572 | 29802 (2)| 00:05:58 |
|* 17 | TABLE ACCESS FULL | REC_SM_STDNT_DEG_COMPLETION | 4 | 452 | 29798 (2)| 00:05:58 |
| 18 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 31050 | 3 (0)| 00:00:01 |
| 19 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 28980 | 3 (0)| 00:00:01 |
|* 20 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 1 (0)| 00:00:01 |
| 21 | SORT AGGREGATE | | 1 | 15 | | |
| 22 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 23 | INDEX RANGE SCAN (MIN/MAX)| PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
| 24 | VIEW | | 1 | 58 | 29813 (2)| 00:05:58 |
| 25 | HASH GROUP BY | | 1 | 45 | 29813 (2)| 00:05:58 |
| 26 | VIEW | | 1 | 45 | 29813 (2)| 00:05:58 |
|* 27 | FILTER | | | | | |
| 28 | HASH GROUP BY | | 1 | 199 | 29813 (2)| 00:05:58 |
| 29 | NESTED LOOPS | | 1 | 199 | 29810 (2)| 00:05:58 |
|* 30 | HASH JOIN | | 1 | 172 | 29809 (2)| 00:05:58 |
|* 31 | HASH JOIN | | 8 | 1152 | 29805 (2)| 00:05:58 |
|* 32 | TABLE ACCESS FULL | REC_SM_STDNT_DEG_COMPLETION | 7 | 798 | 29802 (2)| 00:05:58 |
| 33 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 31050 | 3 (0)| 00:00:01 |
| 34 | INDEX FAST FULL SCAN | PS2RQ_MAIN_TBL | 1035 | 28980 | 3 (0)| 00:00:01 |
|* 35 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 1 (0)| 00:00:01 |
| 36 | SORT AGGREGATE | | 1 | 15 | | |
| 37 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 38 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
| 40 | SORT AGGREGATE | | 1 | 18 | | |
| 41 | FIRST ROW | | 1 | 18 | 2 (0)| 00:00:01 |
|* 42 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_MAIN_TBL | 1 | 18 | 2 (0)| 00:00:01 |
|* 43 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 15 | 1 (0)| 00:00:01 |
| 44 | SORT AGGREGATE | | 1 | 15 | | |
| 45 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 46 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("A"."EMPLID"="C"."EMPLID"(+) AND "A"."ACAD_CAREER"="C"."ACAD_CAREER"(+) AND
"A"."ACAD_PLAN"="C"."ACAD_PLAN"(+) AND "A"."REQ_ACAD_PLAN"="C"."REQ_ACAD_PLAN"(+) AND
"A"."ACADEMIC_LEVEL"="C"."ACADEMIC_LEVEL"(+) AND "A"."REQ_TERM"="C"."REQ_TERM"(+) AND
"A"."RQRMNT_GROUP"="C"."RQRMNT_GROUP"(+))
5 - access("A"."EMPLID"="B"."EMPLID"(+) AND "A"."ACAD_CAREER"="B"."ACAD_CAREER"(+) AND
"A"."ACAD_PLAN"="B"."ACAD_PLAN"(+) AND "A"."REQ_ACAD_PLAN"="B"."REQ_ACAD_PLAN"(+) AND
"A"."ACADEMIC_LEVEL"="B"."ACADEMIC_LEVEL"(+) AND "A"."REQ_TERM"="B"."REQ_TERM"(+) AND
"A"."RQRMNT_GROUP"="B"."RQRMNT_GROUP"(+))
7 - filter("A"."ACAD_PLAN"="A"."REQ_ACAD_PLAN" AND "A"."ACAD_PROG"='UBACH' AND "A"."ACAD_CAREER"='UGRD' AND
"A"."IMPACT_FLAG"='Y' AND "A"."REQUIREMENT" IS NOT NULL AND (SYS_OP_C2C("A"."REQ_ACAD_PLAN")=U'NUPPXXXBBS'
OR
SYS_OP_C2C("A"."REQ_ACAD_PLAN")=U'NURPBASBBS' OR SYS_OP_C2C("A"."REQ_ACAD_PLAN")=U'NURPXXXBBS') AND
(SYS_OP_C2C("A"."ACAD_PLAN")=U'NUPPXXXBBS' OR SYS_OP_C2C("A"."ACAD_PLAN")=U'NURPBASBBS' OR
SYS_OP_C2C("A"."ACAD_PLAN")=U'NURPXXXBBS') AND (SYS_OP_C2C("A"."ACADEMIC_LEVEL")=U'10' OR
SYS_OP_C2C("A"."ACADEMIC_LEVEL")=U'20' OR SYS_OP_C2C("A"."ACADEMIC_LEVEL")=U'30' OR
SYS_OP_C2C("A"."ACADEMIC_LEVEL")=U'40' OR SYS_OP_C2C("A"."ACADEMIC_LEVEL")=U'50' OR
SYS_OP_C2C("A"."ACADEMIC_LEVEL")=U'GR'))
8 - access("D"."ACAD_PLAN"="A"."REQ_ACAD_PLAN")
filter((SYS_OP_C2C("D"."ACAD_PLAN")=U'NUPPXXXBBS' OR SYS_OP_C2C("D"."ACAD_PLAN")=U'NURPBASBBS' OR
SYS_OP_C2C("D"."ACAD_PLAN")=U'NURPXXXBBS') AND "D"."ACAD_PLAN"="A"."REQ_ACAD_PLAN")
12 - filter("M3"."EFFDT"=MAX("M3_ED"."EFFDT"))
15 - access("M3_ED"."REQUIREMENT"="M3"."REQUIREMENT")
filter("M3_ED"."EFFDT"<="B_SUB"."REQ_TERM_BEGIN_DATE")
16 - access("M3"."REQUIREMENT"="B_SUB"."REQUIREMENT")
17 - filter("B_SUB"."REQ_ACAD_PLAN" IS NOT NULL AND "B_SUB"."ACAD_PLAN"="B_SUB"."REQ_ACAD_PLAN" AND
"B_SUB"."ACAD_PROG"='UBACH' AND "B_SUB"."ACAD_CAREER"='UGRD' AND "B_SUB"."IMPACT_FLAG"='Y' AND
"B_SUB"."REQUIREMENT" IS NOT NULL AND "B_SUB"."GRADE"<>'IP')
20 - access("G3"."RQRMNT_GROUP"="B_SUB"."RQRMNT_GROUP")
filter("G3"."EFFDT"= (SELECT MAX("G3_ED"."EFFDT") FROM "HRSA_EXTR"."PS_RQ_GRP_TBL" "G3_ED" WHERE
"G3_ED"."EFFDT"<=:B1 AND "G3_ED"."RQRMNT_GROUP"=:B2))
23 - access("G3_ED"."RQRMNT_GROUP"=:B1 AND "G3_ED"."EFFDT"<=:B2)
27 - filter("M2"."EFFDT"=MAX("M2_ED"."EFFDT"))
30 - access("M2_ED"."REQUIREMENT"="M2"."REQUIREMENT")
filter("M2_ED"."EFFDT"<="C_SUB"."REQ_TERM_BEGIN_DATE")
31 - access("M2"."REQUIREMENT"="C_SUB"."REQUIREMENT")
32 - filter("C_SUB"."ACAD_PLAN"="C_SUB"."REQ_ACAD_PLAN" AND "C_SUB"."ACAD_PROG"='UBACH' AND
"C_SUB"."RQRMNT_LINE_STATUS"='COMP' AND "C_SUB"."IMPACT_FLAG"='Y' AND "C_SUB"."ACAD_CAREER"='UGRD' AND
"C_SUB"."REQUIREMENT" IS NOT NULL AND "C_SUB"."GRADE"<>'IP')
35 - access("G2"."RQRMNT_GROUP"="C_SUB"."RQRMNT_GROUP")
filter("G2"."EFFDT"= (SELECT MAX("G2_ED"."EFFDT") FROM "HRSA_EXTR"."PS_RQ_GRP_TBL" "G2_ED" WHERE
"G2_ED"."EFFDT"<=:B1 AND "G2_ED"."RQRMNT_GROUP"=:B2))
38 - access("G2_ED"."RQRMNT_GROUP"=:B1 AND "G2_ED"."EFFDT"<=:B2)
39 - access("M"."REQUIREMENT"="A"."REQUIREMENT")
filter("M"."EFFDT"= (SELECT MAX("M_ED"."EFFDT") FROM "HRSA_EXTR"."PS_RQ_MAIN_TBL" "M_ED" WHERE
"M_ED"."EFFDT"<=:B1 AND "M_ED"."REQUIREMENT"=:B2))
42 - access("M_ED"."REQUIREMENT"=:B1 AND "M_ED"."EFFDT"<=:B2)
43 - access("G"."RQRMNT_GROUP"="A"."RQRMNT_GROUP")
filter("G"."EFFDT"= (SELECT MAX("G_ED"."EFFDT") FROM "HRSA_EXTR"."PS_RQ_GRP_TBL" "G_ED" WHERE
"G_ED"."EFFDT"<=:B1 AND "G_ED"."RQRMNT_GROUP"=:B2))
46 - access("G_ED"."RQRMNT_GROUP"=:B1 AND "G_ED"."EFFDT"<=:B2)
106 rows selected.New environment, 11.2.0.2, 4000 seconds for all rows:
PLAN_TABLE_OUTPUT
Plan hash value: 4117596694
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 314 | 15231 (1)| 00:03:03 |
| 1 | SORT UNIQUE | | 1 | 314 | 15230 (1)| 00:03:03 |
| 2 | NESTED LOOPS OUTER | | 1 | 314 | 15227 (1)| 00:03:03 |
| 3 | NESTED LOOPS OUTER | | 1 | 285 | 15216 (1)| 00:03:03 |
| 4 | NESTED LOOPS | | 1 | 256 | 15205 (1)| 00:03:03 |
| 5 | NESTED LOOPS | | 1 | 241 | 15204 (1)| 00:03:03 |
| 6 | NESTED LOOPS | | 1 | 223 | 15203 (1)| 00:03:03 |
| 7 | NESTED LOOPS | | 17 | 731 | 15186 (1)| 00:03:03 |
| 8 | VIEW | VW_SQ_3 | 998 | 27944 | 15186 (1)| 00:03:03 |
| 9 | HASH GROUP BY | | 998 | 62874 | 15186 (1)| 00:03:03 |
| 10 | MERGE JOIN | | 29060 | 1787K| 15184 (1)| 00:03:03 |
| 11 | SORT JOIN | | 26 | 1248 | 15180 (1)| 00:03:03 |
| 12 | TABLE ACCESS BY INDEX ROWID | REC_SM_STDNT_DEG_COMPLETION | 26 | 1248 | 15179 (1)| 00:03:03 |
|* 13 | INDEX SKIP SCAN | REC0SM_STDNT_DEG_IDX | 26 | | 15168 (1)| 00:03:03 |
|* 14 | SORT JOIN | | 1217 | 18255 | 4 (25)| 00:00:01 |
| 15 | INDEX FAST FULL SCAN | PS3RQ_GRP_TBL | 1217 | 18255 | 3 (0)| 00:00:01 |
|* 16 | INDEX UNIQUE SCAN | PS_RQ_GRP_TBL | 1 | 15 | 0 (0)| 00:00:01 |
|* 17 | TABLE ACCESS BY USER ROWID | REC_SM_STDNT_DEG_COMPLETION | 1 | 180 | 1 (0)| 00:00:01 |
|* 18 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
| 19 | SORT AGGREGATE | | 1 | 18 | | |
| 20 | FIRST ROW | | 1 | 18 | 2 (0)| 00:00:01 |
|* 21 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_MAIN_TBL | 1 | 18 | 2 (0)| 00:00:01 |
|* 22 | INDEX FULL SCAN | PS0SMO_RDR_IMP_PLN | 1 | 15 | 1 (0)| 00:00:01 |
|* 23 | VIEW PUSHED PREDICATE | | 1 | 29 | 11 (19)| 00:00:01 |
| 24 | SORT GROUP BY | | 1 | 52 | 11 (19)| 00:00:01 |
| 25 | VIEW | VM_NWVW_5 | 1 | 52 | 10 (10)| 00:00:01 |
|* 26 | FILTER | | | | | |
| 27 | SORT GROUP BY | | 1 | 165 | 10 (10)| 00:00:01 |
|* 28 | FILTER | | | | | |
| 29 | NESTED LOOPS | | 1 | 165 | 7 (0)| 00:00:01 |
| 30 | NESTED LOOPS | | 1 | 147 | 6 (0)| 00:00:01 |
| 31 | NESTED LOOPS | | 1 | 117 | 5 (0)| 00:00:01 |
|* 32 | TABLE ACCESS BY INDEX ROWID | REC_SM_STDNT_DEG_COMPLETION | 1 | 90 | 4 (0)| 00:00:01 |
|* 33 | INDEX RANGE SCAN | REC1SM_STDNT_DEG_IDX | 1 | | 3 (0)| 00:00:01 |
|* 34 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 1 (0)| 00:00:01 |
| 35 | SORT AGGREGATE | | 1 | 15 | | |
| 36 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 37 | INDEX RANGE SCAN (MIN/MAX)| PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
|* 38 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 30 | 1 (0)| 00:00:01 |
|* 39 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
|* 40 | VIEW PUSHED PREDICATE | | 1 | 29 | 11 (19)| 00:00:01 |
| 41 | SORT GROUP BY | | 1 | 32 | 11 (19)| 00:00:01 |
| 42 | VIEW | VM_NWVW_4 | 1 | 32 | 10 (10)| 00:00:01 |
|* 43 | FILTER | | | | | |
| 44 | SORT GROUP BY | | 1 | 166 | 10 (10)| 00:00:01 |
|* 45 | FILTER | | | | | |
|* 46 | FILTER | | | | | |
| 47 | NESTED LOOPS | | 1 | 166 | 7 (0)| 00:00:01 |
| 48 | NESTED LOOPS | | 1 | 148 | 6 (0)| 00:00:01 |
| 49 | NESTED LOOPS | | 1 | 118 | 5 (0)| 00:00:01 |
|* 50 | INDEX RANGE SCAN | PS_RQ_GRP_TBL | 1 | 27 | 2 (0)| 00:00:01 |
|* 51 | TABLE ACCESS BY INDEX ROWID | REC_SM_STDNT_DEG_COMPLETION | 1 | 91 | 3 (0)| 00:00:01 |
|* 52 | INDEX RANGE SCAN | REC1SM_STDNT_DEG_IDX | 1 | | 2 (0)| 00:00:01 |
|* 53 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 30 | 1 (0)| 00:00:01 |
|* 54 | INDEX RANGE SCAN | PS_RQ_MAIN_TBL | 1 | 18 | 1 (0)| 00:00:01 |
| 55 | SORT AGGREGATE | | 1 | 15 | | |
| 56 | FIRST ROW | | 1 | 15 | 2 (0)| 00:00:01 |
|* 57 | INDEX RANGE SCAN (MIN/MAX) | PS_RQ_GRP_TBL | 1 | 15 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
13 - access("A"."ACAD_CAREER"='UGRD' AND "A"."ACAD_PROG"='UBACH' AND "A"."IMPACT_FLAG"='Y')
filter("A"."ACAD_PLAN"="A"."REQ_ACAD_PLAN" AND "A"."ACAD_PROG"='UBACH' AND "A"."IMPACT_FLAG"='Y' AND
"A"."ACAD_CAREER"='UGRD')
14 - access(INTERNAL_FUNCTION("G_ED"."EFFDT")<=INTERNAL_FUNCTION("A"."REQ_TERM_BEGIN_DATE"))
filter(INTERNAL_FUNCTION("G_ED"."EFFDT")<=INTERNAL_FUNCTION("A"."REQ_TERM_BEGIN_DATE"))
16 - access("ITEM_5"="G"."RQRMNT_GROUP" AND "G"."EFFDT"="MAX(G_ED.EFFDT)")
17 - filter("SYS_ALIAS_2"."ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN" AND "SYS_ALIAS_2"."ACAD_PROG"='UBACH' AND
"SYS_ALIAS_2"."ACAD_CAREER"='UGRD' AND "SYS_ALIAS_2"."IMPACT_FLAG"='Y' AND "SYS_ALIAS_2"."REQUIREMENT" IS N
OT
NULL AND (SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NUPPXXXBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NURPBASBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NURPXXXBBS') AND
(SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NUPPXXXBBS' OR SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NURPBASBBS'
OR
SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NURPXXXBBS') AND (SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'10'
OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'20' OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'30' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'40' OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'50' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'GR') AND "G"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP")
18 - access("M"."REQUIREMENT"="SYS_ALIAS_2"."REQUIREMENT")
filter("M"."EFFDT"= (SELECT MAX("M_ED"."EFFDT") FROM "HRSA_EXTR"."PS_RQ_MAIN_TBL" "M_ED" WHERE
"M_ED"."EFFDT"<=:B1 AND "M_ED"."REQUIREMENT"=:B2))
21 - access("M_ED"."REQUIREMENT"=:B1 AND "M_ED"."EFFDT"<=:B2)
22 - access("D"."ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN")
filter((SYS_OP_C2C("D"."ACAD_PLAN")=U'NUPPXXXBBS' OR SYS_OP_C2C("D"."ACAD_PLAN")=U'NURPBASBBS' OR
SYS_OP_C2C("D"."ACAD_PLAN")=U'NURPXXXBBS') AND "D"."ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN")
23 - filter("SYS_ALIAS_2"."REQ_TERM"="B"."REQ_TERM"(+))
26 - filter("M3"."EFFDT"=MAX("M3_ED"."EFFDT"))
28 - filter('UGRD'="SYS_ALIAS_2"."ACAD_CAREER" AND "SYS_ALIAS_2"."REQ_ACAD_PLAN"="SYS_ALIAS_2"."ACAD_PLAN")
32 - filter("SYS_ALIAS_2"."REQ_ACAD_PLAN" IS NOT NULL AND
"SYS_ALIAS_2"."REQ_ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN" AND
"SYS_ALIAS_2"."ACADEMIC_LEVEL"="SYS_ALIAS_2"."ACADEMIC_LEVEL" AND "SYS_ALIAS_2"."IMPACT_FLAG"='Y' AND
"SYS_ALIAS_2"."REQUIREMENT" IS NOT NULL AND (SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NUPPXXXBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NURPBASBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NURPXXXBBS') AND (SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'
10'
OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'20' OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'30' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'40' OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'50' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'GR') AND "SYS_ALIAS_2"."GRADE"<>'IP')
33 - access("SYS_ALIAS_2"."EMPLID"="SYS_ALIAS_2"."EMPLID" AND
"SYS_ALIAS_2"."ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN" AND "SYS_ALIAS_2"."ACAD_CAREER"='UGRD' AND
"SYS_ALIAS_2"."ACAD_PROG"='UBACH' AND "SYS_ALIAS_2"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP")
filter("SYS_ALIAS_2"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP" AND "SYS_ALIAS_2"."ACAD_PROG"='UBACH'
AND "SYS_ALIAS_2"."ACAD_CAREER"='UGRD' AND (SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NUPPXXXBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NURPBASBBS' OR SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NURPXXXBBS')
34 - access("G3"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP")
filter("G3"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP" AND "G3"."EFFDT"= (SELECT MAX("G3_ED"."EFFDT")
FROM "HRSA_EXTR"."PS_RQ_GRP_TBL" "G3_ED" WHERE "G3_ED"."EFFDT"<=:B1 AND "G3_ED"."RQRMNT_GROUP"=:B2))
37 - access("G3_ED"."RQRMNT_GROUP"=:B1 AND "G3_ED"."EFFDT"<=:B2)
38 - access("M3"."REQUIREMENT"="SYS_ALIAS_2"."REQUIREMENT")
39 - access("M3_ED"."REQUIREMENT"="M3"."REQUIREMENT" AND "M3_ED"."EFFDT"<="B_SUB"."REQ_TERM_BEGIN_DATE")
40 - filter("SYS_ALIAS_2"."REQ_TERM"="C"."REQ_TERM"(+))
43 - filter("M2"."EFFDT"=MAX("M2_ED"."EFFDT"))
45 - filter("G2"."EFFDT"= (SELECT MAX("G2_ED"."EFFDT") FROM "HRSA_EXTR"."PS_RQ_GRP_TBL" "G2_ED" WHERE
"G2_ED"."EFFDT"<=:B1 AND "G2_ED"."RQRMNT_GROUP"=:B2))
46 - filter('UGRD'="SYS_ALIAS_2"."ACAD_CAREER" AND "SYS_ALIAS_2"."REQ_ACAD_PLAN"="SYS_ALIAS_2"."ACAD_PLAN")
50 - access("G2"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP")
51 - filter("SYS_ALIAS_2"."REQ_ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN" AND
"SYS_ALIAS_2"."ACADEMIC_LEVEL"="SYS_ALIAS_2"."ACADEMIC_LEVEL" AND "SYS_ALIAS_2"."RQRMNT_LINE_STATUS"='COMP'
AND
"SYS_ALIAS_2"."IMPACT_FLAG"='Y' AND "SYS_ALIAS_2"."REQUIREMENT" IS NOT NULL AND
(SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NUPPXXXBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NURPBASBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."REQ_ACAD_PLAN")=U'NURPXXXBBS') AND (SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'
10'
OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'20' OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'30' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'40' OR SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'50' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACADEMIC_LEVEL")=U'GR') AND "SYS_ALIAS_2"."GRADE"<>'IP')
52 - access("SYS_ALIAS_2"."EMPLID"="SYS_ALIAS_2"."EMPLID" AND
"SYS_ALIAS_2"."ACAD_PLAN"="SYS_ALIAS_2"."REQ_ACAD_PLAN" AND "SYS_ALIAS_2"."ACAD_CAREER"='UGRD' AND
"SYS_ALIAS_2"."ACAD_PROG"='UBACH' AND "SYS_ALIAS_2"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP")
filter("SYS_ALIAS_2"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP" AND "SYS_ALIAS_2"."ACAD_PROG"='UBACH'
AND "SYS_ALIAS_2"."ACAD_CAREER"='UGRD' AND (SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NUPPXXXBBS' OR
SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NURPBASBBS' OR SYS_OP_C2C("SYS_ALIAS_2"."ACAD_PLAN")=U'NURPXXXBBS')
AND
"G2"."RQRMNT_GROUP"="SYS_ALIAS_2"."RQRMNT_GROUP")
53 - access("M2"."REQUIREMENT"="SYS_ALIAS_2"."REQUIREMENT")
54 - access("M2_ED"."REQUIREMENT"="M2"."REQUIREMENT" AND "M2_ED"."EFFDT"<="C_SUB"."REQ_TERM_BEGIN_DATE")
57 - access("G2_ED"."RQRMNT_GROUP"=:B1 AND "G2_ED"."EFFDT"<=:B2)Edited by: ngilbert on Jun 26, 2012 5:00 PM
Edited by: ngilbert on Jun 26, 2012 5:05 PM -
Query Tuning (sequential read + direct path read/write temp)
Following query takes nearly 10 minutes under 10.2.0.2 on WIN2K3 to execute but I am sure there would be an alternate to tune it further.
Major waits are 'db file sequential read' and 'direct path read temp' in addition to 'direct path write temp'
Increasing/tuning the work_area_policy/sort_area_size would help? moving the tables to faster disk would reduce PIO causing sequential read, query re-writing would prove to be helpful?.
Below is the tkprof:
SELECT
P.PER_ID
, CL.DESCR
, P.ENG_NAME
, P.ARA_NAME
, P.NATION
, P.ADDR
, ('Mob:' || NVL(P.MOB, '') || ', Home:' || NVL(P.HOME, '') || ', Bus.:' || NVL(P.BUS, '') || ', Fax:' || NVL(P.FAX, '')) PHONE
, SUM(CASE
WHEN FT.FT_TYPE_FLG IN ('BS','BX','AD','AX') THEN FT.CUR_AMT
ELSE 0
END) BILL
, SUM(CASE
WHEN FT.FT_TYPE_FLG IN ('PS','PX') THEN FT.CUR_AMT * -1
ELSE 0
END) PAY
, SUM(FT.CUR_AMT) DUE
, SUM(CASE
WHEN FT.FREEZE_DTTM > '03-JUN-08' THEN
CASE WHEN FT.FT_TYPE_FLG IN ('PS','PX') THEN FT.CUR_AMT * -1
ELSE 0
END
ELSE 0
END) PAY_02JUN
FROM
CI_FT FT
, CI_SA SA
, CI_ACCT_CHAR AC
, CI_CUST_CL_L CL
, CI_ACCT A
, CI_ACCT_PER AP
SELECT
P.PER_ID
, (P.CITY || ', ' || P.STATE || ',' || P.COUNTRY) ADDR
, MAX(DECODE(PP.PHONE_TYPE_CD, 'MOB ', PP.PHONE)) MOB
, MAX(DECODE(PP.PHONE_TYPE_CD, 'BUSN ', PP.PHONE)) BUS
, MAX(DECODE(PP.PHONE_TYPE_CD, 'HOME ', PP.PHONE)) HOME
, MAX(DECODE(PP.PHONE_TYPE_CD, 'FAX ', PP.PHONE)) FAX
, MAX(DECODE(PN.NAME_TYPE_FLG, 'PRIM', PN.ENTITY_NAME)) ENG_NAME
, MAX(DECODE(PN.NAME_TYPE_FLG, 'ALT ', PN.ENTITY_NAME)) ARA_NAME
, MAX(DECODE(PC.CHAR_TYPE_CD, 'NATION ', PC.CHAR_VAL)) NATION
FROM
CI_PER P
, CI_PER_PHONE PP
, CI_PER_NAME PN
, CI_PER_CHAR PC
WHERE
P.PER_ID = PP.PER_ID (+)
AND P.PER_ID = PN.PER_ID (+)
AND P.PER_ID = PC.PER_ID (+)
GROUP BY
P.PER_ID
, (P.CITY || ', ' || P.STATE || ',' || P.COUNTRY)
) P
WHERE
P.PER_ID = AP.PER_ID
AND AP.ACCT_ID = AC.ACCT_ID
AND AP.ACCT_ID = SA.ACCT_ID
AND AP.MAIN_CUST_SW = 'Y'
AND A.ACCT_ID = SA.ACCT_ID
AND A.ACCT_ID = AP.ACCT_ID
AND AC.CHAR_TYPE_CD = 'ACCTYPE'
AND AC.CHAR_VAL IN ('UOS', 'DEFAULT')
AND AC.ACCT_ID = SA.ACCT_ID
AND CL.LANGUAGE_CD = 'ENG'
AND A.ACCT_ID = AC.ACCT_ID
AND A.CUST_CL_CD = CL.CUST_CL_CD
AND SA.SA_ID = FT.SA_ID
AND FT.FREEZE_DTTM IS NOT NULL
GROUP BY
P.PER_ID
, CL.DESCR
, P.ENG_NAME
, P.ARA_NAME
, P.NATION
, P.ADDR
, ('Mob:' || NVL(P.MOB, '') || ', Home:' || NVL(P.HOME, '') || ', Bus.:' || NVL(P.BUS, '') || ', Fax:' || NVL(P.FAX, ''))
HAVING
SUM(FT.CUR_AMT) > 0
call count cpu elapsed disk query current rows
Parse 1 0.64 0.64 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 304 353.09 430.04 21720 52997832 0 4543
total 306 353.73 430.69 21720 52997832 0 4543
Misses in library cache during parse: 1
Optimizer mode: CHOOSE
Parsing user id: 79 (CISADM)
Rows Row Source Operation
4543 FILTER (cr=52997832 pr=21720 pw=10311 time=430019418 us)
5412 HASH GROUP BY (cr=52997832 pr=21720 pw=10311 time=430015729 us)
199471 VIEW (cr=52997832 pr=21720 pw=10311 time=423392346 us)
199471 HASH GROUP BY (cr=52997832 pr=21720 pw=10311 time=423192867 us)
4013304 TABLE ACCESS BY INDEX ROWID CI_FT (cr=52997832 pr=11409 pw=0 time=140469508 us)
17717785 NESTED LOOPS (cr=49295470 pr=8987 pw=0 time=407554071 us)
13704480 NESTED LOOPS (cr=21818135 pr=7655 pw=0 time=287797921 us)
2782119 NESTED LOOPS OUTER (cr=3915432 pr=2950 pw=0 time=38953485 us)
571492 NESTED LOOPS OUTER (cr=2545763 pr=2711 pw=0 time=7433194 us)
286061 NESTED LOOPS OUTER (cr=2253263 pr=2671 pw=0 time=26607373 us)
123411 NESTED LOOPS (cr=1989056 pr=2642 pw=0 time=22711194 us)
123411 NESTED LOOPS (cr=1864959 pr=2642 pw=0 time=20860026 us)
123411 NESTED LOOPS (cr=1494040 pr=1754 pw=0 time=15553373 us)
243088 NESTED LOOPS (cr=29540 pr=1754 pw=0 time=10213331 us)
13227 TABLE ACCESS FULL CI_PER (cr=251 pr=49 pw=0 time=43331 us)
243088 INDEX RANGE SCAN XM150S1 (cr=29289 pr=1705 pw=0 time=6178159 us)(object id 97173)
123411 INLIST ITERATOR (cr=1464500 pr=0 pw=0 time=7220251 us)
123411 INDEX RANGE SCAN CM064S0 (cr=1464500 pr=0 pw=0 time=5631936 us)(object id 108631)
123411 TABLE ACCESS BY INDEX ROWID CI_ACCT (cr=370919 pr=888 pw=0 time=7241286 us)
123411 INDEX UNIQUE SCAN XM148P0 (cr=247508 pr=0 pw=0 time=1198649 us)(object id 97147)
123411 TABLE ACCESS BY INDEX ROWID CI_CUST_CL_L (cr=124097 pr=0 pw=0 time=1391837 us)
123411 INDEX UNIQUE SCAN XC523P0 (cr=686 pr=0 pw=0 time=595005 us)(object id 97745)
283749 TABLE ACCESS BY INDEX ROWID CI_PER_PHONE (cr=264207 pr=29 pw=0 time=3549713 us)
283749 INDEX RANGE SCAN XM172P0 (cr=125886 pr=4 pw=0 time=1307395 us)(object id 98733)
571492 INDEX RANGE SCAN XM171S2 (cr=292500 pr=40 pw=0 time=2976807 us)(object id 98728)
2777066 TABLE ACCESS BY INDEX ROWID CI_PER_CHAR (cr=1369669 pr=239 pw=0 time=23084761 us)
2777066 INDEX RANGE SCAN XM168P0 (cr=596156 pr=53 pw=0 time=7394319 us)(object id 98719)
13704480 TABLE ACCESS BY INDEX ROWID CI_SA (cr=17902703 pr=4705 pw=0 time=163320548 us)
13704480 INDEX RANGE SCAN XM199S1 (cr=5688247 pr=104 pw=0 time=51063061 us)(object id 98973)
4013304 INDEX RANGE SCAN CM112S1 (cr=27477335 pr=1332 pw=0 time=124063022 us)(object id 116797)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 304 0.00 0.00
db file sequential read 11366 0.34 65.63
direct path write temp 1473 0.06 2.91
latch: cache buffers chains 17 0.00 0.00
db file scattered read 7 0.01 0.03
read by other session 2 0.00 0.00
direct path read temp 1473 0.03 6.85
SQL*Net message from client 304 0.02 2.74
SQL*Net more data to client 292 0.00 0.00
********************************************************************************Luckys
I've just realised that I mis-read part of your plan:
199471 HASH GROUP BY (cr=52997832 pr=21720 pw=10311 time=423192867 us)
4013304 TABLE ACCESS BY INDEX ROWID CI_FT (cr=52997832 pr=11409 pw=0 time=140469508 us)
17717785 NESTED LOOPS (cr=49295470 pr=8987 pw=0 time=407554071 us)The time component for a line is the time it supplies, plus the sum of the time from its direct descendents.
In this case I looked at the HASH GROUP BY and TABLE ACCESS and got a difference of about 283 seconds. In fact I should have taken more notice of the other lines in the plan - comparing the HASH GROUP BY with the NESTED LOOP for a difference of about 16 seconds and assuming that the time in the TABLE ACCESS line was not to be trusted. (See http://jonathanlewis.wordpress.com/2007/04/26/heisenberg/ for a couple of comments on the timing issue).
So the grouping is responsible for relatively little of the excess time - most of the time goes into the nested loop.
I shall be using the Hints as advised, when we say we
have to "rewrite the query"
given the current context excluding the HINTS, what
exactly should I be
considering in terms of query rewrite, what
additional intelligence I can add to the
query in question so that CBO produces a different
plan.
The main consideration is what the query is supposed to report. Compare this with the way the optimizer is running the query and see if it makes sense.
When are talking about high intermediate rows
processing are we referring to this
section of the plan?;
4013304 TABLE ACCESS BY INDEX ROWID CI_FT
(cr=52997832 pr=11409 pw=0 time=140469508 us)
17717785 NESTED LOOPS (cr=49295470 pr=8987
pw=0 time=407554071 us)
13704480 NESTED LOOPS (cr=21818135 pr=7655
pw=0 time=287797921 us)
2782119 NESTED LOOPS OUTER (cr=3915432
pr=2950 pw=0 time=38953485 us)
2777066 TABLE ACCESS BY INDEX ROWID
CI_PER_CHAR (cr=1369669 pr=239 pw=0 time=23084761
us)
2777066 INDEX RANGE SCAN XM168P0 (cr=596156
pr=53 pw=0 time=7394319 us)(object id 98719)
13704480 TABLE ACCESS BY INDEX ROWID CI_SA
(cr=17902703 pr=4705 pw=0 time=163320548 us)
13704480 INDEX RANGE SCAN XM199S1
(cr=5688247 pr=104 pw=0 time=51063061 us)(object id
98973)
4013304 INDEX RANGE SCAN CM112S1 (cr=27477335
pr=1332 pw=0 time=124063022 us)(object id 116797)
Correct - one of the nested loops returns 2.78M rows - but as you run the next join you end up collecting 13.7M entires from the next index and table. That step is responsible for quite a lot of your work and time (as is the following step where you USE the 13.7M rows to probe the next index/table combination). If the optimizer had not grown the data set by merging the P view earlier on, the data sizes would be significantly smaller at that point.
Your inline view looks as if it is trying to turn rows into columns (the max(decode()) trick) - which is why I think it might be a good idea to stop Oracle from merging the view. So, as I suggested, look at the query withouth that bit of complexity and work out a sensible way to walk through the tables - bearing in mind the statistics below and the available indexes, and the amount of data your predicates identify at each stage.
Moreover tables have been analyzed:
CI_ACCT 243068
CI_ACCT_CHAR 222320
CI_ACCT_PER 242971
CI_FT 794510
CI_PER 13227
CI_PER_CHAR 42555
CI_PER_PHONE 18488
CI_SA 1082301
Parameters:
optimizer_features_enable string 10.2.0.2
optimizer_index_caching integer 100
optimizer_index_cost_adj integer 1
Unless you've been given strict instructions by a 3rd-part supplier, those settings for the optimizer_index_caching and optimizer_index_cost_adj are particularly bad - especially in 10g. With those settings, the optimizer is quite likely to choose stupid plans with excessive use of indexes - and pick the wrong index while doing it.
It's not appropriate to fiddle with system parameters to address one query - but at some stage you need to rethink your entire set of parameter settings to do things the 10g way. See this note from the Optimizer Group: http://www.oracle.com/technology/products/bi/db/10g/pdf/twp_bidw_optimizer_10gr2_0208.pdf
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"The greatest enemy of knowledge is not ignorance,
it is the illusion of knowledge." Stephen Hawking. -
Oracle hangs on query with multiple joins
To test the sotftware from the LMS-vendor that are out partners we use virtual machines where we install Windows 2003 servers and Oracle XE
While we were testing the software I've found that a particular query with multiple unions causes the CPU of the virtual machine totally claimed by oracle
The query causes oracle to hang.
I've found that the subcomponents of the query all return 0 rows (and response all immediately) combined into a query with at least 2 unions the query hangs the system
I'm not familiar with with Database Management at all
I've read something about SGA and PGA that could be the issue and tried to increase the target for both but it doesn't seem to do anything
Some characterics
Target Current
Maximum System Global Area (SGA) Size: 380 MB 380 MB
Program Global Area (PGA) Aggregate Target: 360 MB 38 MB
Current Configuration: (SGA + PGA): 740 MB 418 MB
Tablespaces Percent Used Allocated (MB) Used (MB) Datafiles
SYSAUX 98.21% 460.00 451.75 1
SYSTEM 73.09% 510.00 372.75 1
DATA 99.13% 440.00 436.19 1
UNDO 6.48% 160.00 10.38 1
USERS 1.63% 100.00 1.63 1
sort_area_size 65536
shared_pool_reserved_size 5452595 TRUE size in bytes of reserved area of shared pool
shared_pool_size 0 TRUE size in bytes of shared pool
What other parameters are important? How could I get a good picture to see what's really going on?
Some pointers, help would be appreciated.
Regards,
RemcoBelow is the base-query that is causing the problems
SELECT /* Public - Internal learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no order_number, e.id person_id, format_name(e.fname , e.lname , @@005) learner_name , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description item_desc, substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id INNER JOIN tpt_company c ON e.company_id = c.id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE e.type = 100 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
UNION
SELECT /* Public - External learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1, r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE e.type = 200 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
UNION
SELECT /* Public - Unassigned learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , null person_id, null , null company_id, null , ent.id entidd, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1, r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,'' org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,'' learner_first_name ,'' learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN tpt_offering_action oa on oa.id = r.offering_action_id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND r.student_id is null AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND @@003 is null
UNION
SELECT /* Private - Internal learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN let_pvt_offering_request pvt_offreq ON pvt_offreq.class_id = r.class_id INNER JOIN tpt_offering_action oa on oa.id = r.offering_action_id LEFT OUTER JOIN tpt_oe_order_items i ON i.part_id = pvt_offreq.id LEFT OUTER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name LEFT OUTER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' LEFT OUTER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 LEFT OUTER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 WHERE e.type = 100 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
UNION
SELECT /* Private - External learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN let_pvt_offering_request pvt_offreq ON pvt_offreq.class_id = r.class_id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_oe_order_items i ON i.part_id = pvt_offreq.id LEFT OUTER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name LEFT OUTER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' LEFT OUTER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name AND orderList.locale_id = @@005 AND orderList.list_id = 'sysli000000000000129' LEFT OUTER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name AND approvalList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' WHERE e.type = 200 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003)) ORDER BY 34,35,28,29,31,30,33,32
Maybe you are looking for
-
Back up iPhone with content purchased under one iTunes ID to a computer using a different iTunes ID
Have iPhone 4 with OS7. Apps on phone purchased under personal iTunes ID. Want to back up on work laptop with another iTunes ID using iCloud for contacts.
-
Photos not showing up on my Touchpad
I recently put a bunch of photos onto by touchpad but when i went to view them only the albums would show up and when I clicked on the albums it would say that they are empty. I then deleted the albums off USB mode (including all the photos) and trie
-
Responsive object test not working
I am working on a tutorial found in the AS Bible for flash 8 which is suposed to create a square which responds to your mouse movement by dragging part of the square to change it's shape. The script works partially, but not all the way. When loading
-
Windows Powershell has stopped working
Hi, I am getting an error during Windows logon, which says "Windows Powershell has stopped working". When I looked at the event logs, I found the below event in App logs. Can you pls help what is going wrong here? Log Name: Application Source:
-
Pdf one tab of a multiple tab Xcel document
We use pdf to send proposals. Our proposal document is one tab of a multi-tab Xcel document. In the past, it appeared that as long as the proposal document was the last (far right) tab, that pdf chose and sent just this document for processing. We ha