PARALLEL QUERY WRONG RESULT WHEN USING HASH JOIN (Doc ID 1533551.1)

Last updated on MARCH 27, 2014

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Information in this document applies to any platform.

Symptoms

WRONG RESULTS IN PARALLEL QUERY WHEN USING HASH JOIN

For example the following query provides wrong result.
As could be seen from the Plan HASH JOIN is used:

SQL> select
partnerid, st.stichtag "St", oe.stichtag "Oe"
from
(select /*+ parallel (a,8)) */ a.partnerid, a.brrrfc, min(stichtag)
stichtag from srk30.imp_brr a
where a.brrrfc='Oe' group by a.partnerid, a.brrrfc) oe
inner join
(select /*+ parallel (b,8)) */ b.partnerid, b.brrrfc, max(stichtag)
stichtag from srk30.imp_brr b
where b.brrrfc='St' group by b.partnerid, b.brrrfc) st
using (partnerid)
order by
partnerid;


Execution Plan
----------------------------------------------------------
Plan hash value: 1340239850
.
------------------------------------------------------------------------------
-----------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost
(%CPU)| Time |
------------------------------------------------------------------------------
-----------
| 0 | SELECT STATEMENT | | 920K| 29M| | 59204
(2)| 00:13:49 |
| 1 | MERGE JOIN | | 920K| 29M| | 59204
(2)| 00:13:49 |
| 2 | SORT JOIN | | 218K| 3620K| | 29693
(2)| 00:06:56 |
| 3 | VIEW | | 218K| 3620K| | 29693
(2)| 00:06:56 |
| 4 | HASH GROUP BY | | 218K| 4259K| 13M| 29693
(2)| 00:06:56 |
|* 5 | TABLE ACCESS FULL| IMP_BRR | 218K| 4259K| | 28851
(2)| 00:06:44 |
|* 6 | SORT JOIN | | 88112 | 1462K| 4848K| 29505
(2)| 00:06:54 |
| 7 | VIEW | | 88112 | 1462K| | 29193
(2)| 00:06:49 |
| 8 | HASH GROUP BY | | 88112 | 1720K| 5552K| 29193
(2)| 00:06:49 |
|* 9 | TABLE ACCESS FULL| IMP_BRR | 88112 | 1720K| | 28851
(2)| 00:06:44 |

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms