Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

query performance with or without bind variable (parallelism Hint)

jmarcApr 17 2018 — edited Apr 18 2018

hello,

i work on apex 5.1.4, oracle 12.1.0.2.0

i have a performance problem in classic report so i decide to execute the same query in apex sql workshop

1) i execute in apex sql worskshop-->sql commands the following query with bind variable :P67_ORGA

(i set in the dialog box for P67_ORGA the value FRA404)

WITH REFER as (

select unique substr(temps,1,4) annee

     ,e.employe

     ,r.rubsrh

     ,t.temps

     ,s.scenar

from EMPLOYE_NONE_TABLE e,RUBSRH_STANDARD_table r, TEMPS_STD_MOIS_TABLE t, SCENAR_NONE_TABLE s

where  t.L1 = '2018'

   and SCENAR = 'LE16_B17'

   and RUBSRH = 'ABS_AT_TR_MAL_PRO'

   and EMPLOYE in (select /*+ PARALLEL(nomemp_code_table,4) */ employe

                    from nomemp_code_table

                    where scenar = 'LE16_B17'

                    and temps in (select temps from TEMPS_STD_MOIS_TABLE where L1_MOD ='2018' )

                    and matpres_code = 1

                    and employe not in (select employe from employe_none_table where etre_OD_CODE = 1)

                    and matorg_code in (select orga from orga_standard_table where  instr(tous_niveau,'#'  || :P67_ORGA || '#') >0)

                    and matref1_code in (select axemet from axemet_standard_table where instr(tous_niveau,'#' || 'M0001' || '#') > 0)

)

)

select (select e.employe  from employe_none_table e where e.employe = emp.employe) EMP_LIB

     ,RUB_01

FROM (

select r.rubsrh

     ,r.annee

     ,r.scenar 

     ,r.employe

   ,sum( CASE WHEN r.temps = r.annee  ||'01'  THEN b.budgetsal ELSE null END)  RUB_01

from REFER r

left outer join budgetsal_table b on (  b.scenar=r.scenar and b.temps=r.temps and b.rubsrh=r.rubsrh and b.employe= r.employe)

group by r.rubsrh,r.annee,r.scenar,r.employe

     )emp

it returns 75 rows in 114 seconds

the explain plan is

Query Plan

OperationOptionsObjectRowsTimeCostBytesFilter
Predicates *
Access
Predicates
SELECT STATEMENT

47,55231783,0773,994,368

PX COORDINATOR

PX SEND

QC (RANDOM):TQ1000947,55231783,0773,994,368

EXPRESSION EVALUATION

HASH

GROUP BY 47,55231783,0773,994,368

PX RECEIVE

47,55231783,0773,994,368

PX SEND

HASH:TQ1000847,55231783,0773,994,368

HASH

GROUP BY 47,55231783,0773,994,368

HASH JOIN

OUTER 452,62414342,48738,020,416"B"."SCENAR"(+) = "R"."SCENAR" AND "B"."TEMPS"(+) = "R"."TEMPS" AND "B"."RUBSRH"(+) = "R"."RUBSRH" AND "B"."EMPLOYE"(+) = "R"."EMPLOYE"

PX RECEIVE

437,117114,93518,358,914

PX SEND

HASH:TQ10007437,117114,93518,358,914

VIEW

437,117114,93518,358,914

HASH

UNIQUE 437,117114,93592,231,687

PX RECEIVE

437,117114,93592,231,687

PX SEND

HASH:TQ10006437,117114,93592,231,687

HASH

UNIQUE 437,117114,93592,231,687

HASH JOIN

RIGHT SEMI 1,379,085114,910290,986,935"EMPLOYE" = "EMPLOYE"

BUFFER

SORT

PX RECEIVE

97,539176877,851

PX SEND

BROADCAST:TQ1000097,539176877,851

INDEX

FAST FULL SCANEMPLOYE_NONE_TABLE_IDX97,539176877,851

HASH JOIN

RIGHT SEMI 1,379,085114,831278,575,170"MATREF1_CODE" = "AXEMET"

BUFFER

SORT

PX RECEIVE

4981725,896

PX SEND

BROADCAST:TQ100014981725,896

TABLE ACCESS

FULLAXEMET_STANDARD_TABLE4981725,896INSTR("TOUS_NIVEAU",'#M0001#')>0

HASH JOIN

RIGHT ANTI NA 1,379,085114,822206,862,750"EMPLOYE" = "EMPLOYE"

BUFFER

SORT

PX RECEIVE

1153522

PX SEND

BROADCAST:TQ100021153522

TABLE ACCESS

FULLEMPLOYE_NONE_TABLE1153522"ETRE_OD_CODE" = 1

HASH JOIN

RIGHT SEMI 1,379,100114,284176,524,800
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2018
Added on Apr 17 2018
5 comments
297 views