Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: where to put PARALLEL DEGREE in comples SELECT statement
JW
PARALLEL DEGREE is DDL i.e. something you specify at create table time. To "parallelize" your query (assuming your OS has multiple processors, your init.ora parameters are set to allow it etc) you need to use hints:-
> select /*+ PARALLEL(a,8) PARALLEL(b,8) */ yyyymm, subcount, totcount, subcount/totcount*100 pct
> from
> (select /*+ PARALLEL(BSID,8) */ substr(BUDAT, 1,6) yyyymm, count(*) subcount from BSID
> group by substr(BUDAT, 1,6)) a,
> (select /*+ PARALLEL(BSID,8) */ count(*) totcount from BSID) b;
>
OR you can alter the table BSID to set a default degree for the table, which Oracle should use at execution time (ALTER TABLE bsid PARALLEL 8;)
HTH Adrian Received on Tue Feb 12 2002 - 02:53:39 CST