How to stop using parallel slaves? 2005-10-10 - By Sami Seerangan
Hi:
I don't know how optimizer decides to use PARALLEL SLAVES to run such a small query.
One of my non-resource intensive query(look at the statistics) is started using parallel slave unnecessarily even though 1) any of the tables and indexes involved in the query does not have parallel degree 2) no parallel hint in SQL statement
I am thinking it may be because of parallel_automatic_tuning is set to TRUE. Since it is static parameter I cannot do anything now to stop using parallel slaves for this small query.
The reasons why I don't want this query to use parallel slaves are
1) This query runs very often & it consumes all possible 50 parallel slaves (max limit).
2) Because of the above, our replication Push Job fails which requires parallel slaves.
ORA-12012 (See ORA-12012.ora-code.com): error on auto execute of job 61 ORA-23386 (See ORA-23386.ora-code.com): replication parallel push cannot create slave processes ORA-06512 (See ORA-06512.ora-code.com): at "SYS.DBMS_DEFER_SYS", line 1716 ORA-06512 (See ORA-06512.ora-code.com): at "SYS.DBMS_DEFER_SYS", line 1804 ORA-06512 (See ORA-06512.ora-code.com): at line 1
I cannot modify the query to put NO PARALLEL hint either.
Mu question:
Is there any work around to stop using parallel slaves for this small query?
-- ---- ---- ---- ---- ---- ---- ---- ---- ----
SQL> show parameter parallel
NAME TYPE VALUE -- ---- ---- ---- ---- ---- ---- --- -- ---- --- -- ---- ---- ---- ---- ---- -- fast_start_parallel_rollback string LOW log_parallelism integer 1 parallel_adaptive_multi_user boolean TRUE parallel_automatic_tuning boolean TRUE parallel_execution_message_size integer 4096 parallel_instance_group string parallel_max_servers integer 50 parallel_min_percent integer 0 parallel_min_servers integer 0 parallel_server boolean TRUE parallel_server_instances integer 3 parallel_threads_per_cpu integer 2 recovery_parallelism integer 0
SQL> set autotrace on SQL> get res.sql 1* SELECT DISTINCT RES_REGION.REGION FROM RES_ISSUE RESI,RES_REGION,(SELECT RES_PK FROM RES_ISSUE MINUS (SELECT RESI.RES_PK FROM RES_ISSUE RESI,RES_RESTRICTED_CNTRY,CNTRY WHERE RESI.RES_PK=RES_RESTRICTED_CNTRY.RES_PK AND RES_RESTRICTED_CNTRY.CNTRY_PK= CNTRY.CNTRY_PK AND CNTRY.CNTRY_CODE='GB')) RES_FILTERED_LIST WHERE RESI.TIER<= 100 AND RESI.DELETE_DOC=0 AND RES_FILTERED_LIST.RES_PK=RESI.RES_PK AND RESI.RES_PK=RES_REGION.RES_PK AND RESI.FILE_FMT='PDF' ORDER BY RES_REGION.REGION ASC SQL> /
Execution Plan -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=341 Card=5 Bytes=215 )
1 0 SORT (UNIQUE) (Cost=273 Card=5 Bytes=215) 2 1 HASH JOIN (Cost=145 Card=33618 Bytes=1445574) 3 2 HASH JOIN (Cost=126 Card=18862 Bytes=546998) 4 3 TABLE ACCESS (FULL) OF 'RES_ISSUE' (Cost=57 Card=18862 Bytes=301792) 5 3 VIEW (Cost=70 Card=37884 Bytes=492492) 6 5 MINUS 7 6 SORT (UNIQUE) 8 7 INDEX (FAST FULL SCAN) OF 'P_RES_ISSUE' (UNIQUE) (Cost=6 Card=37884 Bytes=227304) 9 6 SORT (UNIQUE) 10 9 NESTED LOOPS* (Cost=17 Card=439 Bytes=10097) :Q55028000 11 10 NESTED LOOPS* (Cost=17 Card=439 Bytes=7463) :Q55028000 12 11 INDEX* (FAST FULL SCAN) OF 'RES_RESTRICTED :Q550280_CNTRY_CHK1' (NON-UNIQUE) (Cost=17 Card=107992 Bytes=107992000) 13 11 INDEX* (RANGE SCAN) OF 'CNTRY_CHK1' (NON-U :Q550280NIQUE) 00 14 10 INDEX* (UNIQUE SCAN) OF 'P_RES_ISSUE' (UNIQU :Q550280 E) 00 15 2 INDEX (FAST FULL SCAN) OF 'RES_REGION_CHK1' (NON-UNIQUE) (Cost=19 Card=49824 Bytes=697536) 10 PARALLEL_TO_SERIAL SELECT /*+ ORDERED NO_EXPAND USE_NL(A2) INDE X(A2 "P_RES_ISSUE") */ A1.C0,A1.C1,A 11 PARALLEL_COMBINED_WITH_PARENT 12 PARALLEL_COMBINED_WITH_PARENT 13 PARALLEL_COMBINED_WITH_PARENT 14 PARALLEL_COMBINED_WITH_PARENT
Statistics -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 0 recursive calls 0 db block gets 1769 consistent gets 0 physical reads 0 redo size 608 bytes sent via SQL*Net to client 651 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 4 sorts (memory) 0 sorts (disk) 5 rows processed
<span style="font-family: courier new,monospace;">Hi:<br> <br> I don't know how optimizer decides to use PARALLEL SLAVES to run such a small query.<br> <br> <br> One of my non-resource intensive query(look at the statistics) is started using parallel slave unnecessarily even though<br> 1) any of the tables and indexes involved in the query does not have parallel degree<br> 2) no parallel hint in SQL statement<br> <br> I am thinking it may be because of </span><span style="font-family: courier new ,monospace;">parallel_automatic_tuning is set to TRUE. Since it is static parameter I cannot do anything now to stop using parallel slaves for this small query.<br> <br> The reasons why I don't want this query to use parallel slaves are<br> <br> 1) This query runs very often & it consumes all possible 50 parallel slaves (max limit).<br> <br> 2) Because of the above, our replication Push Job fails which requires parallel slaves.<br> <br> ORA-12012 (See ORA-12012.ora-code.com): error on auto execute of job 61<br> ORA-23386 (See ORA-23386.ora-code.com): replication parallel push cannot create slave processes<br> ORA-06512 (See ORA-06512.ora-code.com): at "SYS.DBMS_DEFER_SYS", line 1716<br> ORA-06512 (See ORA-06512.ora-code.com): at "SYS.DBMS_DEFER_SYS", line 1804<br> ORA-06512 (See ORA-06512.ora-code.com): at line 1<br> <br> I cannot modify the query to put NO PARALLEL hint either.<br> <br> <br> Mu question:<br> <br> Is there any work around to stop using parallel slaves for this small query? <br> <br> -- ---- ---- ---- ---- ---- ---- ---- ---- ----<br> </span><span style="font-family: courier new,monospace;"><br> SQL> show parameter parallel</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;"> </span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">NAME TYPE VALUE</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">-- ---- ---- ---- ---- ------ -- ---- -- ---- --- -- ---- ---- ---- ---- ---- --</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">fast_start_parallel_rollback string LOW</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">log_parallelism integer 1</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">parallel_adaptive_multi_user boolean TRUE</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">parallel_automatic_tuning boolean TRUE</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">parallel_execution_message _size integer 4096</span> <br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">parallel_instance_group string< /span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">parallel_max_servers integer 50</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">parallel_min_percent integer 0</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">parallel_min_servers integer 0</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">parallel_server boolean TRUE</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">parallel_server_instances integer 3</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">parallel_threads_per_cpu  ; integer 2</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">recovery_parallelism integer 0</span><br style="font-family: courier new ,monospace;"> <br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">SQL> set autotrace on< /span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">SQL> get res.sql</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 1* SELECT DISTINCT RES_REGION.REGION FROM RES_ISSUE RESI,RES_REGION,(SELECT RES_PK FROM RES_ISSUE MINUS (SELECT RESI.RES_PK FROM RES_ISSUE RESI,RES_RESTRICTED_CNTRY,CNTRY WHERE RESI.RES_PK=RES_RESTRICTED_CNTRY.RES_PK AND RES_RESTRICTED_CNTRY.CNTRY_PK=CNTRY.CNTRY_PK AND CNTRY.CNTRY_CODE='GB')) RES_FILTERED_LIST WHERE RESI.TIER <= 100 AND RESI.DELETE_DOC=0 AND RES_FILTERED_LIST.RES_PK=RESI.RES_PK AND RESI.RES_PK=RES_REGION.RES_PK AND RESI.FILE_FMT='PDF' ORDER BY RES_REGION.REGION ASC</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">SQL> /</span><br style= "font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> </span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">Execution Plan</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">-- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ------</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;"> 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=341 Card=5 Bytes=215< /span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; )</span><br style="font-family: courier new,monospace; "> <span style="font-family: courier new,monospace;"> </span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 1 0 SORT (UNIQUE) (Cost=273 Card=5 Bytes=215)</span><br style= "font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 2 1 HASH JOIN (Cost=145 Card=33618 Bytes=1445574)< /span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 3 2 HASH JOIN (Cost=126 Card=18862 Bytes=546998)</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 4 3 TABLE ACCESS (FULL) OF 'RES_ISSUE' (Cost=57 Card=18862 Bytes=301792) </span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 5 3 VIEW (Cost=70 Card =37884 Bytes=492492)</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 6 5 MINUS</span ><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 7 6 SORT (UNIQUE)</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 8 7 INDEX (FAST FULL SCAN) OF 'P_RES_ISSUE' (UNIQUE) (Cost=6 Card=37884 Bytes=227304) </span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 9 6 SORT (UNIQUE)</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 10 9 NESTED LOOPS* (Cost=17 Card=439 Bytes=10097) :Q55028000 </span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 11 10   ; NESTED LOOPS* (Cost=17 Card=439 Bytes=7463) :Q55028000 </span><br style= "font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 12 11   ; INDEX* (FAST FULL SCAN) OF 'RES_RESTRICTED :Q550280_CNTRY_CHK1' (NON-UNIQUE) (Cost=17 Card=107992 Bytes=107992000) </span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 13 11   ; INDEX* (RANGE SCAN) OF 'CNTRY_CHK1' (NON-U :Q550280NIQUE) 00 </span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 14 10   ; INDEX* (UNIQUE SCAN) OF 'P_RES_ISSUE' (UNIQU :Q550280 E) 00 </span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;"> 15 2 INDEX (FAST FULL SCAN) OF 'RES_REGION_CHK1' (NON-UNIQUE) (Cost=19 Card=49824 Bytes=697536)</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 10 PARALLEL_TO_SERIAL SELECT /*+ ORDERED NO_EXPAND USE_NL(A2) INDE X(A2 "P_RES_ISSUE") */ A1.C0,A1.C1,A</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 11 PARALLEL_COMBINED _WITH_PARENT</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 12 PARALLEL_COMBINED _WITH_PARENT</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 13 PARALLEL_COMBINED _WITH_PARENT</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> 14 PARALLEL_COMBINED _WITH_PARENT</span><br style="font-family: courier new,monospace;"> <br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> Statistics</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> -- ---- ---- ---- ----- -- ---- ---- ---- ---- ---- ---- --</span><br style="font-family: courier new ,monospace;"> <span style="font-family: courier new,monospace;">   ; 0 recursive calls</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 0 db block gets</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 1769 consistent gets</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 0 physical reads</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 0 redo size</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 608 bytes sent via SQL*Net to client</span><br style= "font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 651 bytes received via SQL*Net from client</span><br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 2 SQL*Net roundtrips to/from client</span> <br style="font-family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 4 sorts (memory)</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 0 sorts (disk)</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;">   ; 5 rows processed</span><br style="font -family: courier new,monospace;"> <span style="font-family: courier new,monospace;"> </span><br style="font -family: courier new,monospace;"> <br style="font-family: courier new,monospace;">
|
|