UNION ALL bug - 11g
I have a strange bug with Oracle 11g. I was trying tu use Microsoft Entity Framework; the queries produced are a bit special and some of them are using UNION ALL in a way that produces an error.
Let us create this very very simple table (I used SQL Developer and let the default) :
CREATE TABLE "USER"."TABLE1"
( "COLUMN1" VARCHAR2(4000 BYTE),
"COLUMN2" NUMBER
Try this query, even without data :
SELECT * FROM(
SELECT NULL AS C1 FROM USER.TABLE1
UNION ALL
SELECT NULL AS C1 FROM USER.TABLE1
UNION ALL
SELECT COLUMN2 FROM USER.TABLE1
this produces a "*Expression must have same datatype as corresponding expression*" error !
Now if you do the same on COLUM1 of type VARCHAR2 :
SELECT * FROM(
SELECT NULL AS C1 FROM USER.TABLE1
UNION ALL
SELECT NULL AS C1 FROM USER.TABLE1
UNION ALL
SELECT COLUMN1 FROM USER.TABLE1
No error is raised, the query is executed normally.
Note that if you do :
SELECT * FROM(
SELECT NULL AS C1 FROM USER.TABLE1
UNION ALL
SELECT COLUMN2 FROM USER.TABLE1
no error is raised.
What's happening ??!!
Edited by: user5485007 on 12 sept. 2008 04:34
In 10.2.0.4:
SQL> CREATE TABLE t1
2 ( "COLUMN1" VARCHAR2(4000 BYTE)
3 , "COLUMN2" NUMBER
4 )
5 /
Table created.
SQL> SELECT * FROM(
2 SELECT NULL AS C1 FROM t1
3 UNION ALL
4 SELECT NULL AS C1 FROM t1
5 )
6 UNION ALL
7 SELECT COLUMN2 FROM t1
8 /
SELECT * FROM(
ERROR at line 1:
ORA-01790: expression must have same datatype as corresponding expression
SQL> SELECT * FROM(
2 SELECT NULL AS C1 FROM t1
3 UNION ALL
4 SELECT NULL AS C1 FROM t1
5 )
6 UNION ALL
7 SELECT COLUMN1 FROM t1
8 /
no rows selected
SQL> SELECT * FROM(
2 SELECT NULL AS C1 FROM t1
3 )
4 UNION ALL
5 SELECT COLUMN2 FROM t1
6 /
no rows selectedThe same as the original poster on 11g ...
Regards,
Rob.
Similar Messages
-
How can I join/Full outer join two different columns instead of union all?
Hi,
I have a scenario as the following:
I am performing set operations using obiee 11g where I want to take values from two different criteria. Howwver, I dont want union to take place, instead i want join to take place to see all the columns in the output.
For that, I tried changing the sql in advanced tab and tried to put full outer join instead of union all but its not allowing me to change.
How can I achieve it? please help.
Thanks.Hi,
My problem is that I am unable to modify the sql in advanced tab. Probably due to some security reason,it's restricting me to change.
Can you suggest me a way to change it?
Thanks.. -
Union All vs. View Creation Problem
Here is my problem basicly;
I have three table.
select * from table1;
select * from table2;
select * from table3;
I need to create one view by combining those tables with 'union all' word.
create or replace view view1 as
select * from table1;
union all
select * from table2;
union all
select * from table3;
Then, I want to write a query as;
select * from view1 where column1 = x;
When I did this, view1 first combines all the rows of the tables, then searches x value in all the data. That's OK. However I want to first search x value in the tables, and combine the results of each table and get the result rows.
I mean, my query "select * from view1 where column1 = x;" need to act as
select * from table1;
column1 = x
union all
select * from table2;
column1 = x
union all
select * from table3;
column1 = x
How can I do this?
Thanks everyone..SnigRO
I think what you mean is that your query is sequentially full scanning all three tables, and you would like instead for it to use index scans.
Show the plan for the query. The predicate can be pushed down, but whether it makes any difference may depend:
- statistics on each table (full scan may be faster than index scan)
- are the various column1 columns indexed
- certain documented or hidden optimiser parameters can encourage or discourage push down: eg optimizercost_based_transformation
- Oracle version: there have been known bugs that interfere with push down (eg Bug 3723007 - Predicate push down may not occur in 10g - reported in 10.1)
HTH
Regards Nigel -
Improve performance with union all
Hello there,
Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
SQL> show parameter optimizer
ORA-00942: Tabel of view bestaat niet. (Does not exist)I have the following query using the following input variables
- id
- startdate
- enddate
The query has the following format
- assume that the number of columns are the same
- t1 != t3 and t2 != t4
select ct.*
from
select t1.*
from tabel1 t1
join tabel2 t2
on t2.key = t1.key
union all
select t3.*
from tabel3 t3
join tabel4 t4
on t4.key = t3.key
where ct.id = :id
and ct.date >= :startdate
and ct.date < :enddate
order by ct.dateIt is performing really slow, after the first read it performs fast.
I tried the following thing, which was actually even slower!
with t1c as
select t1.*
from tabel1 t1
join tabel2 t2
on t2.key = t1.key
where t1.id = :id
and t1.date >= :startdate
and t1.date < :enddate
t2c as
select t3.*
from tabel3 t3
join tabel4 t4
on t4.key = t3.key
where t3.id = :id
and t3.date >= :startdate
and t3.date < :enddate
select ct.*
from
select *
from t1c
union all
select *
from t2c
order by ct.dateSo in words, I have an 'union all' construction reading from different tables with matching columns 'id' and 'date'.
How can I improve this? Can it be improved? If you do not know the answer, but maybe a suggestion, I will be happy aswell!!!
Thanks in advance!
Kind regards,
Metroickha>
So in words, I have an 'union all' construction reading from different tables with matching columns 'id' and 'date'.
How can I improve this? Can it be improved? If you do not know the answer, but maybe a suggestion, I will be happy aswell!!!
>
If you want to improve on what Oracle is doing you first need to know 'what Oracle is doing'.
Post the execution plans for the query that show what Oracle is doing.
Also post the DDL for the tables and indexes and the record counts for the tables and ID/DATE predicates. -
Inconsistent SQL results when using View with UNION-ALL and table function
Can any of you please execute the below scripts and check the output. In the table type variable, I am adding 4 distinct object ids, where as in the result, I get only the row pertaining to last id in the table type variable. Same row is returned 4 times (4= number of values in the table type).
This scenario is occurring in our product with a SQL with exactly same pattern. I could simulate the same issue with the sample script I have provided.
Database version: 11.2.0.3 Enterprise Edition, Single node
Thank you.
CREATE TABLE TEMP_T1 AS SELECT * FROM ALL_OBJECTS;
CREATE TABLE TEMP_T2 AS SELECT * FROM ALL_OBJECTS;
UPDATE TEMP_T2 SET OBJECT_ID = OBJECT_ID * 37;
CREATE UNIQUE INDEX TEMP_T1_U1 ON TEMP_T1(OBJECT_ID);
CREATE UNIQUE INDEX TEMP_T2_U1 ON TEMP_T2(OBJECT_ID);
CREATE OR REPLACE VIEW TEMP_T1T2_V AS
SELECT * FROM TEMP_T1 UNION ALL SELECT * FROM TEMP_T2;
CREATE OR REPLACE TYPE TEMP_OBJ_TYPE AS OBJECT (OBJ_ID NUMBER);
CREATE OR REPLACE TYPE TEMP_OBJ_TAB_TYPE IS TABLE OF TEMP_OBJ_TYPE;
SET SERVEROUTPUT ON;
DECLARE
TYPE TEMP_T1T2_V_ROW_TAB_TYPE IS TABLE OF TEMP_T1T2_V%ROWTYPE;
TEMP_T1T2_V_ROW_TAB TEMP_T1T2_V_ROW_TAB_TYPE;
TEMP_OBJ_TAB TEMP_OBJ_TAB_TYPE := TEMP_OBJ_TAB_TYPE();
PROCEDURE ADD_TO_TEMP_OBJ_TAB(OBJ_ID IN NUMBER) IS
BEGIN
TEMP_OBJ_TAB.EXTEND;
TEMP_OBJ_TAB(TEMP_OBJ_TAB.LAST) := TEMP_OBJ_TYPE(OBJ_ID);
END;
BEGIN
ADD_TO_TEMP_OBJ_TAB(100);
ADD_TO_TEMP_OBJ_TAB(116);
ADD_TO_TEMP_OBJ_TAB(279);
ADD_TO_TEMP_OBJ_TAB(364);
DBMS_OUTPUT.PUT_LINE('=====================');
FOR I IN TEMP_OBJ_TAB.FIRST..TEMP_OBJ_TAB.LAST
LOOP
DBMS_OUTPUT.PUT_LINE('OBJ_ID = '||TEMP_OBJ_TAB(I).OBJ_ID);
END LOOP;
DBMS_OUTPUT.PUT_LINE('---------------------');
SELECT * BULK COLLECT INTO TEMP_T1T2_V_ROW_TAB
FROM TEMP_T1T2_V VW
WHERE ((VW.OBJECT_ID) IN (SELECT OBJ_ID
FROM TABLE(CAST(TEMP_OBJ_TAB AS TEMP_OBJ_TAB_TYPE))));
FOR I IN TEMP_OBJ_TAB.FIRST..TEMP_OBJ_TAB.LAST
LOOP
DBMS_OUTPUT.PUT_LINE('OBJ_ID = '||TEMP_OBJ_TAB(I).OBJ_ID);
END LOOP;
DBMS_OUTPUT.PUT_LINE('---------------------');
IF TEMP_T1T2_V_ROW_TAB.COUNT > 0 THEN
FOR I IN TEMP_T1T2_V_ROW_TAB.FIRST..TEMP_T1T2_V_ROW_TAB.LAST
LOOP
DBMS_OUTPUT.PUT_LINE(TEMP_T1T2_V_ROW_TAB(I).OBJECT_ID||' : '||TEMP_T1T2_V_ROW_TAB(I).OBJECT_NAME);
END LOOP;
ELSE
DBMS_OUTPUT.PUT_LINE('NO ROWS RETURNED!');
END IF;
DBMS_OUTPUT.PUT_LINE('---------------------');
END;
/I can reproduce it:
SQL*Plus: Release 11.2.0.3.0 Production on Tue Oct 30 14:05:39 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: scott
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select *
2 from v$version
3 /
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL> CREATE TABLE TEMP_T1 AS SELECT * FROM ALL_OBJECTS;
Table created.
SQL>
SQL> CREATE TABLE TEMP_T2 AS SELECT * FROM ALL_OBJECTS;
Table created.
SQL>
SQL> UPDATE TEMP_T2 SET OBJECT_ID = OBJECT_ID * 37;
72883 rows updated.
SQL>
SQL> CREATE UNIQUE INDEX TEMP_T1_U1 ON TEMP_T1(OBJECT_ID);
Index created.
SQL>
SQL> CREATE UNIQUE INDEX TEMP_T2_U1 ON TEMP_T2(OBJECT_ID);
Index created.
SQL>
SQL> CREATE OR REPLACE VIEW TEMP_T1T2_V AS
2 SELECT * FROM TEMP_T1 UNION ALL SELECT * FROM TEMP_T2;
View created.
SQL>
SQL> CREATE OR REPLACE TYPE TEMP_OBJ_TYPE AS OBJECT (OBJ_ID NUMBER)
2 /
Type created.
SQL> CREATE OR REPLACE TYPE TEMP_OBJ_TAB_TYPE IS TABLE OF TEMP_OBJ_TYPE
2 /
Type created.
SQL> SET SERVEROUTPUT ON;
SQL>
SQL> DECLARE
2 TYPE TEMP_T1T2_V_ROW_TAB_TYPE IS TABLE OF TEMP_T1T2_V%ROWTYPE;
3 TEMP_T1T2_V_ROW_TAB TEMP_T1T2_V_ROW_TAB_TYPE;
4 TEMP_OBJ_TAB TEMP_OBJ_TAB_TYPE := TEMP_OBJ_TAB_TYPE();
5 PROCEDURE ADD_TO_TEMP_OBJ_TAB(OBJ_ID IN NUMBER) IS
6 BEGIN
7 TEMP_OBJ_TAB.EXTEND;
8 TEMP_OBJ_TAB(TEMP_OBJ_TAB.LAST) := TEMP_OBJ_TYPE(OBJ_ID);
9 END;
10 BEGIN
11 ADD_TO_TEMP_OBJ_TAB(100);
12 ADD_TO_TEMP_OBJ_TAB(116);
13 ADD_TO_TEMP_OBJ_TAB(279);
14 ADD_TO_TEMP_OBJ_TAB(364);
15 DBMS_OUTPUT.PUT_LINE('=====================');
16 FOR I IN TEMP_OBJ_TAB.FIRST..TEMP_OBJ_TAB.LAST
17 LOOP
18 DBMS_OUTPUT.PUT_LINE('OBJ_ID = '||TEMP_OBJ_TAB(I).OBJ_ID);
19 END LOOP;
20 DBMS_OUTPUT.PUT_LINE('---------------------');
21 SELECT * BULK COLLECT INTO TEMP_T1T2_V_ROW_TAB
22 FROM TEMP_T1T2_V VW
23 WHERE ((VW.OBJECT_ID) IN (SELECT OBJ_ID
24 FROM TABLE(CAST(TEMP_OBJ_TAB AS TEMP_OBJ_TAB_TYPE))));
25 FOR I IN TEMP_OBJ_TAB.FIRST..TEMP_OBJ_TAB.LAST
26 LOOP
27 DBMS_OUTPUT.PUT_LINE('OBJ_ID = '||TEMP_OBJ_TAB(I).OBJ_ID);
28 END LOOP;
29 DBMS_OUTPUT.PUT_LINE('---------------------');
30 IF TEMP_T1T2_V_ROW_TAB.COUNT > 0 THEN
31 FOR I IN TEMP_T1T2_V_ROW_TAB.FIRST..TEMP_T1T2_V_ROW_TAB.LAST
32 LOOP
33 DBMS_OUTPUT.PUT_LINE(TEMP_T1T2_V_ROW_TAB(I).OBJECT_ID||' : '||TEMP_T1T2_V_ROW_TAB(I).OBJECT_NAME);
34 END LOOP;
35 ELSE
36 DBMS_OUTPUT.PUT_LINE('NO ROWS RETURNED!');
37 END IF;
38 DBMS_OUTPUT.PUT_LINE('---------------------');
39 END;
40 /
=====================
OBJ_ID = 100
OBJ_ID = 116
OBJ_ID = 279
OBJ_ID = 364
OBJ_ID = 100
OBJ_ID = 116
OBJ_ID = 279
OBJ_ID = 364
364 : I_AUDIT
364 : I_AUDIT
364 : I_AUDIT
364 : I_AUDIT
PL/SQL procedure successfully completed.
SQL> column object_name format a30
SQL> select object_id,
2 object_name
3 from dba_objects
4 where object_id in (100,116,279,364)
5 /
OBJECT_ID OBJECT_NAME
100 ORA$BASE
116 DUAL
279 MAP_OBJECT
364 I_AUDIT
SQL> Works fine in:
=====================
OBJ_ID = 100
OBJ_ID = 116
OBJ_ID = 279
OBJ_ID = 364
OBJ_ID = 100
OBJ_ID = 116
OBJ_ID = 279
OBJ_ID = 364
100 : ORA$BASE
116 : DUAL
364 : SYSTEM_PRIVILEGE_MAP
279 : MAP_OBJECT
PL/SQL procedure successfully completed.
SQL> select object_id,
2 object_name
3 from dba_objects
4 where object_id in (100,116,279,364)
5 /
OBJECT_ID OBJECT_NAME
100 ORA$BASE
116 DUAL
364 SYSTEM_PRIVILEGE_MAP
279 MAP_OBJECT
SQL> select *
2 from v$version
3 /
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL>SY.
Edited by: Solomon Yakobson on Oct 30, 2012 2:14 PM -
Different results using View with union all in 11R1 compared to 10R2
Hello,
I have the following situation:
In Oracle 10R2 I defined a view which looks like this
create view test_view
as
select 'field1;field2;field3' field from dual
union all
select field
from (
select tfield1||';'||tfield2||';'||tfield3 field
from table1
order by tfield1,tfield2,tfield3
The idea is, my first line contains a header information an then the data in the required sorting order.
So, in 10R2, when I export the view with select field from test_view, I get the result as expected, which means, the header from the part with the dual was in the first line and after that, the data in the required sort order.
Now, in 11.1.0.7, it is completely different, because the row of the dual is somewhere in my result set. But if I send the sql instead of the view, I get the expected result as in 10R2.
I have no idea why this is the case now, because in 10R2 this was working permanently as expected. When I look at the execution plan, I see, that he starts parallelisation, which is ok, but the difference is, that in this parallelisation the select from dual is included and in 10R2 he first make the line from the dual and then the parallelisation with the data. It's not clear to me, that if I send the sql to the database I see the required result, but if i define the view as mentioned, and start a select field from view, I get now get the different sorting, because of the parallelisation, where the optimizer he changes his behavior comparing the both database versions. So my question ist, how can I change this behavior to get the same behavior as in release 10R2.
Best regards
RainerHello,
thank you for your sample, I see your idea for my sorting purpose.
I want to look at the following point:
I create the table, as you described. The table has the degree and instances 1. Now I deefine the following view:
create view view_test
as
select 'field1;field2;field3' field
from dual
union all
select tfield1 || ';' || tfield2 || ';' || tfield3 field
from (select * from table1 order by tfield1,tfield2).
This is the way I used it in 10 R2.
Now, the SQL select field from view_test delivers the expected result:
field1;field2;field3
a;b;c
d;e;f
So far so good. But now, I changed the degree of the table1 (alter table table1 parallel (degree 4 instances 1);).
The result looks like that:
a;b;c
field1;field2;field3
d;e;f
So, the parallelisation of my object seems to be the reason for the, in my eyes, "wrong" sort order. In 10R2 I used this degree and instance values for my table and defined a view and it was working fine. Now, after our migration, I had this "trouble". For me it seems, that the optimizer made some changes, or mabe this is a bug, who knows ?
I also tried, to change the nls_comp, and set the undocumented parameters as described in the Metalink note 7497640.8, but with no effect of my result set.
Best regards
Rainer -
Excluding slow table access in a UNION ALL view
Hi,
I have a view which unions three tables together.
One component of the view requires a table scan, as 90% of the records are required.
This view is then used in another outer select where these records are actually not required.
So I tagged each component with a code and excluded that in the outer select. However it still appears to access the table.
Is there any way I can exclude a component of the UNION ALL or do I need to explicitly split them?
example:
SELECT * FROM (
SELECT 'A' Q, JANUARY F FROM ENORMOUS.TABLE WHERE KEY = 'Non Selective Key' UNION ALL
SELECT 'B' Q, 1 F FROM DUAL UNION ALL
SELECT 'C' Q, 1 F FROM DUAL
) A
WHERE Q = 'B'
When I run the query plan without the WHERE it performs the table scan
When I include the WHERE it still performs the table scan but with a FILTER NULL IS NOT NULL afterwards.
So it appears that it is doing the table scan regardless and then throwing the records away - is that correct?
Any thoughts appreciated. I would prefer not the split this view out if possible as it is used everywhere.In summary my question is: is The Oracle query planner smart enough to exclude a component from a load of stacked UNION ALL queries?
given this query:
CREATE VIEW TEST AS
SELECT Q, F
FROM
SELECT 'A' Q, JANUARY F FROM ENORMOUS.TABLE WHERE KEY = 'Non Selective Key' UNION ALL
SELECT 'B' Q, 1 F FROM DUAL UNION ALL
SELECT 'C' Q, 1 F FROM DUAL
) A;
-- 1. This one selects from all tables, including a table scan on the enormous table
SELECT * FROM TEST;
-- 2. This one selects from all tables, including a table scan on the enormous table
-- However the query plan has a FILTER after the table scan. Does it exclude this work?
SELECT * FROM TEST WHERE Q = 'B';When I run the query plan without the WHERE it performs the table scan
When I include the WHERE the query plan indicates it's doing the table scan but with a FILTER NULL IS NOT NULL afterwards.
So it appears that it is doing the table scan regardless and then throwing the records away - is that correct?
Any thoughts appreciated. I would prefer not the split this view out if possible as it is used everywhere.
Oracle version:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 64-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
Plan output for 1:
SELECT STATEMENT Optimizer Mode=ALL_ROWS (Cost=7166 Card=2 M Bytes=41 M)
1 VIEW (Cost=7166 Card=2 M Bytes=41 M)
2 1 UNION-ALL
3 2 TABLE ACCESS FULL PLANNING.BF_GEN_STATS_TRAN (Cost=7162 Card=2 M Bytes=72 M)
4 2 FAST DUAL (Cost=2 Card=1)
5 2 FAST DUAL (Cost=2 Card=1)
Plan output for 2:
SELECT STATEMENT Optimizer Mode=ALL_ROWS (Cost=2 Card=3 Bytes=48)
1 VIEW (Cost=2 Card=3 Bytes=48)
2 1 UNION-ALL
3 2 FILTER
4 3 TABLE ACCESS FULL PLANNING.BF_GEN_STATS_TRAN (Cost=7162 Card=2 M Bytes=72 M)
5 2 FAST DUAL (Cost=2 Card=1)
6 2 FILTER
7 6 FAST DUAL (Cost=2 Card=1) -
Multiple UNION ALL views within a view returning incorrect records?
Hi,
I have a view which selects from multiple views with UNION ALL joining them. If I just select from the larg UNION ALL query I return more records (correct amount) than If I create a view, and select from it.
e.g.
SELECT *
FROM vw_load_1
UNION ALL
SELECT *
FROM vw_load_2
UNION ALL
SELECT *
FROM vw_load_3
UNION ALL
SELECT *
FROM vw_load_4
UNION ALL
SELECT *
FROM vw_load_5
Returns 405 Records
but
CREATE VIEW vw_master_load
AS
SELECT *
FROM vw_load_1
UNION ALL
SELECT *
FROM vw_load_2
UNION ALL
SELECT *
FROM vw_load_3
UNION ALL
SELECT *
FROM vw_load_4
UNION ALL
SELECT *
FROM vw_load_5;
SELECT COUNT(*)
FROM vw_master_load
Returns 307 records
Can anyone explain why, or how to get around this?
Oracle version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - ProductionHi,
Are you saying that you run:
select count(*) from (
SELECT *
FROM vw_load_1
UNION ALL
SELECT *
FROM vw_load_2
UNION ALL
SELECT *
FROM vw_load_3
UNION ALL
SELECT *
FROM vw_load_4
UNION ALL
SELECT *
FROM vw_load_5
result is: 307 And then you run
SELECT *
FROM vw_load_1
UNION ALL
SELECT *
FROM vw_load_2
UNION ALL
SELECT *
FROM vw_load_3
UNION ALL
SELECT *
FROM vw_load_4
UNION ALL
SELECT *
FROM vw_load_5
returns 405 rowsIf so, that is very strange.
Can you an example we can re-produce?
Regards,
Peter -
집합 연산자(UNION, UNION ALL, INTERSECT, MINUS) 사용 예제
제품 : ORACLE SERVER
작성날짜 : 2002-04-12
집합 연산자(UNION, UNION ALL, INTERSECT, MINUS) 사용 예제
=========================================================
Purpose
집합 연산자인 union, union all, intersect, minus 의 사용방법을 알아보자.
Explanation
오라클에서 사용할 수 있는 집합 연산자는 union, union all, intersect,
minus 가 있다.
아래의 table은 예제에서 사용될 테이블이다.
SQL> select * from dept_a;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 RND SEOUL
SQL> select * from dept_b;
DEPTNO DNAME LOC
20 RESEARCH DALLAS
30 SALES CHICAGO
60 FNA SEOUL
1. UNION Operator
union은 두 테이블의 자료를 하나의 결과로 가져올 때,
중복된 row가 있을 경우 하나의 row만을 return한다..
select 문 절에 사용하는 distinct 와 같은 효과로 생각할 수 있다.
SQL> select deptno, dname from dept_a
2 union
3 select deptno, dname from dept_b;
DEPTNO DNAME
10 ACCOUNTING
20 RESEARCH
30 SALES
40 OPERATIONS
50 RND
60 FNA
6 rows selected.
2. UNION ALL Operator
union all 은 union이 distinct 를 사용할 때와 달리 중복된
결과를 모두 return한다. 즉, 결과로 나오는 모든 row를 보여주게 된다.
SQL> select deptno, dname from dept_a
2 union all
3 select deptno, dname from dept_b;
DEPTNO DNAME
10 ACCOUNTING
20 RESEARCH
30 SALES
40 OPERATIONS
50 RND
20 RESEARCH
30 SALES
60 FNA
8 rows selected.
3. INTERSECT Operator
intersect 는 두 테이블의 결과중에 겹치는 row만을 return한다.
즉, 교집합된 결과로 생각할 수 있다.
SQL> select deptno, dname from dept_a
2 intersect
3 select deptno, dname from dept_b;
DEPTNO DNAME
20 RESEARCH
30 SALES
4. MINUS Operator
minus operator는 첫번째 테이블에서 두번째 테이블의 데이터를
제외한 나머지 row만 return한다.
SQL> select deptno, dname from dept_a
2 minus
3 select deptno, dname from dept_b;
DEPTNO DNAME
10 ACCOUNTING
40 OPERATIONS
50 RNDDefinitely a bug:
SQL> ALTER SESSION SET NLS_SORT=BINARY_CI
2 /
Session altered.
SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC
2 /
Session altered.
SQL> with utbl as (
2 select chr(ascii('A') + level - 1) letter
3 from dual
4 connect by level < 27
5 ),
6 ltbl as (
7 select chr(ascii('a') + level - 1) letter
8 from dual
9 connect by level < 27
10 )
11 select letter
12 from utbl
13 minus
14 select letter
15 from ltbl
16 /
L
A
B
C
D
E
F
G
H
I
J
K
L
L
M
N
O
P
Q
R
S
T
U
V
L
W
X
Y
Z
26 rows selected.
SQL> with utbl as (
2 select chr(ascii('A') + level - 1) letter
3 from dual
4 connect by level < 27
5 ),
6 ltbl as (
7 select chr(ascii('a') + level - 1) letter
8 from dual
9 connect by level < 27
10 )
11 select * from (
12 select letter
13 from utbl
14 minus
15 select letter
16 from ltbl
17 )
18 /
no rows selected
SQL> SY. -
Materialized view - REFRESH FAST ON COMMIT - UNION ALL
In a materialized view which uses REFRESH FAST ON COMMIT to update the data, how many UNION ALL can be used.
I am asking this question because my materialized view works fine when there are only 2 SELECT statement (1 UNION ALL).
Thank you.In a materialized view which uses REFRESH FAST ON COMMIT to update the data, how many UNION ALL can be used.As far as I remember you can have 64K UNIONized selects.
I am asking this question because my materialized view works fine when there are only 2 SELECT statement (1 UNION ALL).Post SQL that does not work. -
OAF Export button fetching data in one column - view object using union all
Dear All,
Export button showing data in one column from view object,
View object is based on mulitple queries with union all ,
Please let me know the solution for this issue.
Thanks
Maheswara RajuMaheswara Raju,
As per my understanding you are not able to export all the View Attribute using export Button. Only the attribute which is used with the item/region will get exported.
There are few work around in case if you want to export the column without showing on OAF Page. Let me know.
Cheers
Gyan -
Error while executing UNION ALL query
Hello everyone,
I'm executing the below query on Oracle 9.2.0.8 version.
select hdr.*
from ttl_hdr hdr, ttl_service ser
where hdr.cus_nbr = ser.cus_nbr
and hdr.dn in ('1232','2342',343','343')
union all
select hdr.*
from ttl_hdr_his hdr, ttl_service ser
where hdr.cus_nbr = ser.cus_nbr
and hdr.dn in ('1232','2342',343','343')
and I encounter following error:
ORA-01790: expression must have same datatype as corresponding expression
But instead of * if I'm specifying a list of few columns, it executes the query properly.
Can anybody tell me what the problem is ?
regards,
RossyHi,
All columns in your tables TTL_HDR and TTL_HDR_HIS are not with same data type.
I'm sure you get same error if you specify all columns that * brings.
Specify column names and use conversion function to get data type same to column from both selects.
PS: and I think this is not Application Express related
Br, Jari -
Updatable Materialized View with Union ALL
(please don't ask about db structure)
DB: 11gR2
create table table_1 (
id number primary key,
val varchar2(100)
create table table_2 (
id number primary key,
val varchar2(100)
insert into table_1(id) values (0);
insert into table_1(id) values (2);
insert into table_1(id) values (3);
insert into table_1(id) values (4);
insert into table_1(id) values (5);
insert into table_2(id) values (10);
insert into table_2(id) values (12);
insert into table_2(id) values (13);
insert into table_2(id) values (14);
insert into table_2(id) values (15);
update table_1 set val='Table1 val:'||id;
update table_2 set val='Table2 val:'||id;
create view v_table_all as
select * from table_1
view V_TABLE_ALL created.
select * from v_table_all;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 Table1 val:3
4 Table1 val:4
5 Table1 val:5
select column_name, updatable, insertable, deletable
from user_updatable_columns
where table_name = 'V_TABLE_ALL'
COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
ID YES YES YES
VAL YES YES YES
update v_table_all set val='XXX changed' where id = 3;
1 row updated.
select * from table_1;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 XXX changed
4 Table1 val:4
5 Table1 val:5
rollback;
select * from table_1;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 Table1 val:3
4 Table1 val:4
5 Table1 val:5
create or replace view v_table_all as
select * from table_1
union select * from table_2;
view V_TABLE_ALL created.
select * from v_table_all;
ID VAL
0 Table1 val:0
2 Table1 val:2
3 Table1 val:3
4 Table1 val:4
5 Table1 val:5
10 Table2 val:10
12 Table2 val:12
13 Table2 val:13
14 Table2 val:14
15 Table2 val:15
select column_name, updatable, insertable, deletable
from user_updatable_columns
where table_name = 'V_TABLE_ALL'
COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
ID NO NO NO
VAL NO NO NO
trying update:
update v_table_all set val='XXX changed' where id = 3;
SQL-Fehler: ORA-01732: Datenmanipulationsoperation auf dieser View nicht zulässig
01732. 00000 - "data manipulation operation not legal on this view"
*Cause:
*Action:
drop view v_table_all;
view V_TABLE_ALL dropped.all is ok before this point.
now we want create a new materialized view with some query
create materialized view v_table_all
as
select * from table_1
union all select * from table_2 ;
materialized view V_TABLE_ALL created.
select column_name, updatable, insertable, deletable
from user_updatable_columns
where table_name = 'V_TABLE_ALL'
COLUMN_NAME UPDATABLE INSERTABLE DELETABLE
ID YES YES YES
VAL YES YES YES it seems to be ok with update.
but...
update v_table_all set val='XXX changed' where id = 3;
SQL-Fehler: ORA-01732: Datenmanipulationsoperation auf dieser View nicht zulässig
01732. 00000 - "data manipulation operation not legal on this view"
*Cause:
*Action:How can solve this issue??
Any suggestionLooks like user_updatable_columns sort of thinks the MV is just a table - I don't know about that...
An MV on a single table can be updated - I tried that and it works:
create materialized view mv_table_1 for update
as
select * from table_1;I noticed [url http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/advmv.htm#sthref294]examples stating the UNION ALL needs a "marker" so Oracle can know from the data which source table a row in the MV originates from - like this:
create materialized view v_table_all for update
as
select 'T1' tab_id, table_1.* from table_1
union all
select 'T2' tab_id, table_2.* from table_2 ;But that also fails (the "marker" requirement was specifically for FAST REFRESH, so it was just a long shot ;-) )
What are you planning to do?
<li>Create the MV.
<li>Update records in the MV - which then is no longer consistent with the source data.
<li>Schedule a complete refresh once in a while - thereby overwriting/losing the updates in the MV.
If that is the case, I suggest using a true table rather than an MV.
<li>Create table t_table_all as select ... .
<li>Update records in the table - which then is no longer consistent with the source data.
<li>Schedule a job to delete table and insert into table select ... once in a while - thereby overwriting/losing the updates in the table.
In other words a kind of "do it yourself MV".
I cannot see another way at the moment? But perhaps try in the data warehousing forum - the people there may have greater experience with MV's ;-) -
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 -
Hi All,
I have a requirement as below.
SELECT 'A' AS 'XXX' FROM DUAL
UNION ALL
SELECT 'B' AS 'XXX' FROM DUAL
I need to check in such a way in my second sql query if 'B'='A' then i need to print 'A' else 'B' , means in my second query i need to compare the value of XXX with the first query value of XXX if it is same then i need to print first query's value of XXX or else need to print second queries XXX value.
Please help me on thisuser13424229 wrote:
Hi All,
I have a requirement as below.
SELECT 'A' AS 'XXX' FROM DUAL
UNION ALL
SELECT 'B' AS 'XXX' FROM DUAL
I need to check in such a way in my second sql query if 'B'='A' then i need to print 'A' else 'B' , means in my second query i need to compare the value of XXX with the first query value of XXX if it is same then i need to print first query's value of XXX or else need to print second queries XXX value.
Please help me on thisYour quesiton is not very clear, I would suggest you read {message:id=9360002}.
If you are looking at a way to see the next or previous row from your current row then you can use LEAD or LAG analytical function. They are well documented. You can read all about it there.
Maybe you are looking for
-
Want to delete the source file from the ext Hard drive using iphoto11
I am testing using the external hard drive and turn off "copy items to the iphoto library", I put the iphoto library remain in the osx system disk. In case I forget to turn on the HD, iphoto still work. But the problem that I have is that I have no w
-
HELP! Macbook will not wake! Please help!
+2.0ghz 13.3 Macbook Aluminum from OCT 2008 (MB466LL)+ +OS: Leopard 10.5.8+ Issue: Computer will boot, but will immediately go into some type of soft sleep mode. If I press the power button to wake it from sleep, it will attempt to wake by flickering
-
Having many problems in TB 31.1.2. Selecting an email address from address book used to be very FAST; type in a couple of letters and hit enter. Now there is a distinct and long pause before the selection appears after typing in a couple of letters.
-
I'm having some issues with OLAP on an upgrade from 11.2.0.1 to 11.2.0.2. I found a thread of similar nature where the component goes into a "OPTION OFF" status. Anyway, the product is of no value since we can't pay to use it. It seems like removing
-
Notification not sent when deadline passes
Hi all! I have defined deadline monitoring Latest End and Requested End for several steps in Workflow. The time is static (X days from Work Item Creation). The action is Modelled. When deadline passes, notification must be sent to receipient. The pro