| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> PQO and PSO optimisation problem
Can anyone suggest a good Parallel Query or Parallel Server strategy for the following problem:
I have 7 tables with about 2 million rows each. Table structure is:
date, id1, id2, value
(id1,id2,date) is the unique key
A set of 7 tables represents one week, and the date column is actually the partitioning column when I UNION ALL a large number of these tables. (i.e. the date is the same for all rows in any given table).
I want to product a weekly aggregate
(id1, id2, value)
using code like:
create table weekly
parallel (degree N instances M)
unrecoverable
storage (freelists 1 freelist groups 6)
as
select id1,id2,sum(value) from
(
select id1,id2,value from sunday union all
select id1,id2,value from monday union all
....
select id1,id2,value from saturday
)
group by id1,id2
;
The size of the aggregate table will also be about 2M rows.
Now, a simple query such as:
select count(*) from sunday;
takes about 10 seconds but the best I have done in the query above
is 14 minutes. My target is 3-4 minutes.
The problem, as I see it, is that each sum requires one row from each of the separate UNIONed selects, so there has to be a very large amount of traffic between the parallel query slaves to resolve the problem.
The question (finally):
Has anyone got any suggestion for
a) optimal values of N and M above that might help
b) hints anywhere in the code that might help
c) an alternative strategy
Configuration:
Oracle 7.3.2
Parallel Query Option
Parallel Server option (6 instances)
--- Jonathan Lewis ora_mail_at_jlcomp.demon.co.ukReceived on Mon Nov 04 1996 - 00:00:00 CST
![]() |
![]() |