seal
07-20-2005, 01:18 PM
Hi fellows,
I'm trying to find a solution to the following query almost 2 days, and feel found something but do not know the rationale behind it;((
DB is Oracle Version 9.2.0.1.0 and my table is as follows
TABLE
(
MID NUMBER(1),
SID NUMBER(4),
TYPE NUMBER(1),
NO NUMBER(18),
SEG NUMBER(2),
P_TYPE NUMBER(1),
Z NUMBER,
C NUMBER,
D NUMBER
)
and contains 9.200.000 records.On this table the following query is run
create table test2 as
select /*+PARALLEL(test,10)*/decode(mod(mid,2),1,'O','I') as mid,seg,p_type,
count(distinct no) as scnt,sum(c) as gc,sum(d) as gd
from TEST
group by decode(mod(mid,2),1,'O','I'),seg,p_type
At each run this SQL generates different scnt, gc and gd. After numeruos tries I guessed that PARALLEL clause causes this fault (may be because of threads? or processes? for each distinct parallel server) and removed it. After removal, it always gave the same value;(( Is this a misusage of PARALLEL (The group by expression is always made by different threads and so different groupings are made each time??)? Or is this a bug? or What is the reason, please help;))
Best Regs..
seal
I'm trying to find a solution to the following query almost 2 days, and feel found something but do not know the rationale behind it;((
DB is Oracle Version 9.2.0.1.0 and my table is as follows
TABLE
(
MID NUMBER(1),
SID NUMBER(4),
TYPE NUMBER(1),
NO NUMBER(18),
SEG NUMBER(2),
P_TYPE NUMBER(1),
Z NUMBER,
C NUMBER,
D NUMBER
)
and contains 9.200.000 records.On this table the following query is run
create table test2 as
select /*+PARALLEL(test,10)*/decode(mod(mid,2),1,'O','I') as mid,seg,p_type,
count(distinct no) as scnt,sum(c) as gc,sum(d) as gd
from TEST
group by decode(mod(mid,2),1,'O','I'),seg,p_type
At each run this SQL generates different scnt, gc and gd. After numeruos tries I guessed that PARALLEL clause causes this fault (may be because of threads? or processes? for each distinct parallel server) and removed it. After removal, it always gave the same value;(( Is this a misusage of PARALLEL (The group by expression is always made by different threads and so different groupings are made each time??)? Or is this a bug? or What is the reason, please help;))
Best Regs..
seal