Skip to Main Content
  • Questions
  • SQL Fetch performance degraded after upgrade from 12C to 19C

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Ambuj.

Asked: August 02, 2021 - 3:57 pm UTC

Last updated: August 06, 2021 - 1:44 am UTC

Version: "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.10.0.0.0"

Viewed 10K+ times! This question is

You Asked

Recently we upgraded our database from 12C(12.1) to 19C(19.10). After upgrade we are experiencing many of our SQL reports are running slow.
We have some reports which fetches more than 600,000 records. These reports use to take 18-20 minutes in 12C but now these are taking 35-40 minutes to complete. We found that initial read is almost same in both versions for these reports which is 2-3 minutes but total fetch time has increased from 15-16 minutes to 35-36 minutes.
We have not made change to our hardware or network or any other thing which can affect the total fetch time of query other than database upgrade.
Surprisingly when I added "Order By" clause to query, initial fetch increase by few seconds(because of sorting overhead) but total fetch time came back to 15-16 minutes.
We are not able to figure out the reason for this behavior database. Is Oracle not storing the result set to buffer cache(without sorting condition) that may be the reason for this behavior? Is there any bug in this version of database?
Please help us with this.

and Connor said...

Based on this

Surprisingly when I added "Order By" clause to query

my first hypothesis would that its a network issue, because we do automatic compression on query results in terms of de-duplicating repeated data and sorted data will de-dup much better.

But probably best thing to do here is trace the performance via

exec dbms_monitor.session_trace_enable(waits=>true)
run your query
exec dbms_monitor.session_trace_disable


and then run tkprof on the trace file. Feel free to post the tkprof section for the query here as a comment and we'll take a look

Rating

  (5 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Likely not relevant

Tyler Forsyth, August 04, 2021 - 8:50 pm UTC

I read "SQL report" and I know many people refer to SQL Server as "SQL" so that put me on to a problem I recently had with a client upgrading from 12.1 to 19.7. Thought I'd drop that in here in case it's applicable at all. This would only be applicable if the OP is actually talking about SQL as in SQL Server :)

Performance Issue After Upgrading Oledb Driver To 12.2 And Above (Doc ID 2694472.1)

Changes

Upgraded OLEDB driver to 12.2 and above (19c)
Cause

Issue is due to below bug:
BUG 30395329 - PERFORMANCE ISSUE AFTER UPGRADING OLE DB DRIVER TO 12.2 AND ABOVE (19.3)
Solution

Issue is fixed in Windows DB Bundle patch 19.7.0.0.2004142 which can be downloaded from below links.
For 19.7 : PATCH 30901317
Connor McDonald
August 05, 2021 - 3:21 am UTC

Thanks for the info

Ambuj Kumar, August 04, 2021 - 8:51 pm UTC

Here is the tkprof of SQL statement(SQL included). Can you please also explain de-duplication in case of without sort and with sort. I did not understand it completely. Thank you.

TKPROF: Release 19.0.0.0.0 - Development on Wed Aug 4 11:42:03 2021

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Trace file: C02EBS_ora_4815_test_pl1.trc
Sort options: prsela  exeela  fchela  
********************************************************************************
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing 
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
********************************************************************************

SELECT
  t.co,
  t.CO_DESC,
  t.gac,
  t.gac_description GAC_DESC,
  t.gac
  || '-'
  || gac_description GAC_AND_DESC,
  t.lac,
  t.dept_func_cd,
  t.dept_function dept_func,
  t.ico,
  t.bu,
  t.bu_description BU_DESC,
  SUBSTR(t.bu, 1, 2) bu2,
  t.gac_type AS GAC_TYPE,
  t.fs_cat_1,
  t.fs_cat_2,
  t.fs_cat_3,
  t.cost_element_1,
  t.cost_element_2,
  t.pnl_line_summary,
  t.mda_category,
  t.business_group rptg_grp,
  t.reporting_unit rptg_unit,
  t.nongaap_pnl,
  t.top_co_grp,
  t.CO_GRP,
  t.short_name,
  t.status,
  t.gng,
  t.le_type,
  t.controller,
  t.region,
  t.country,
  t.currency_code cy_cd,
  t.q1cy_2,
  t.q2cy_2,
  t.q3cy_2,
  t.q4cy_2,
  CASE
    WHEN (t.cost_element_1 IN ('xx','xx not on xx'))
    THEN t.q4cy_2
    ELSE t.q1cy_2 + t.q2cy_2 + t.q3cy_2 + t.q4cy_2
  END cy_2,
  t.q1cy_1,
  t.q2cy_1,
  t.q3cy_1,
  t.q4cy_1,
  CASE
    WHEN (t.cost_element_1 IN ('xx','xx not on xx'))
    THEN t.q4cy_1
    ELSE t.q1cy_1 + t.q2cy_1 + t.q3cy_1 + t.q4cy_1
  END cy_1,
  t.q1cy_0 q1cy,
  t.q2cy_0 q2cy,
  t.q3cy_0 q3cy,
  t.q4cy_0 q4cy,
  CASE
    WHEN (t.cost_element_1 IN ('xx','xx not on xx'))
    THEN t.cm
    ELSE t.q1cy_0 + t.q2cy_0 + t.q3cy_0 + t.q4cy_0
  END cy,
  t.cm_5,
  t.cm_4,
  t.cm_3,
  t.cm_2,
  t.cm_1,
  t.cm,
  sysdate TIMESTAMP
FROM
  (SELECT t.co,
    t.CO_DESC,
    t.short_name,
    t.gac,
    t.gac_description,
    t.gac_type,
    t.lac,
    t.ico,
    t.bu,
    t.bu_description,
    t.dept_function,
    t.dept_func_cd,
    t.region,
    t.country,
    t.fs_cat_1,
    t.fs_cat_2,
    t.fs_cat_3,
    t.cost_element_1,
    t.cost_element_2,
    t.pnl_line_summary,
    t.mda_category,
    t.nongaap_pnl,
    t.business_group,
    t.reporting_unit,
    t.gng,
    t.status,
    t.le_type,
    t.controller,
    t.top_co_grp,
    t.co_grp,
    t.currency_code,
    SUM(t.q1cy_2) q1cy_2,
    SUM(t.q2cy_2) q2cy_2,
    SUM(t.q3cy_2) q3cy_2,
    SUM(t.q4cy_2) q4cy_2,
    SUM(t.q1cy_1) q1cy_1,
    SUM(t.q2cy_1) q2cy_1,
    SUM(t.q3cy_1) q3cy_1,
    SUM(t.q4cy_1) q4cy_1,
    SUM(t.q1cy_0) q1cy_0,
    SUM(t.q2cy_0) q2cy_0,
    SUM(t.q3cy_0) q3cy_0,
    SUM(t.q4cy_0) q4cy_0,
    -- sum(t.last_qtr) last_qtr,
    SUM(t.cm_5) cm_5,
    SUM(t.cm_4) cm_4,
    SUM(t.cm_3) cm_3,
    SUM(t.cm_2) cm_2,
    SUM(t.cm_1) cm_1,
    SUM(t.cm) cm
  FROM
    (SELECT /*+ full(xgcc) */
      xgcc.segment1 co,
      co_flex.description CO_DESC,
      xgcc.segment2 gac,
      acct_flex.description gac_description,
      xgcc.gl_account_type gac_type,
      xgcc.segment3 lac,
      xgcc.segment5 ico,
      xgcc.segment7 bu,
      bu_flex.description bu_description,
      xgcc.dept_function,
      SUBSTR(xgcc.segment4,1,2) dept_func_cd,
      xgcc.region,
      xgcc.country,
      xgcc.fs_cat_1,
      xgcc.fs_cat_2,
      xgcc.fs_cat_3,
      xgcc.cost_element_1,
      xgcc.cost_element_2,
      xgcc.pnl_line_summary,
      xgcc.mda_category,
      xgcc.nongaap nongaap_pnl,
      xgcc.business_group,
      xgcc.reporting_unit,
      xgcc.gng,
      xgcc.status,
      xgcc.le_type,
      fu.description controller,
      xgcc.top_co_group top_co_grp,
      xgcc.co_group co_grp,
      b.currency_code,
      xgcc.short_name,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q1CY_2_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q1CY_2'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q1CY_2,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q2CY_2_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q2CY_2'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q2CY_2,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q3CY_2_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q3CY_2'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q3CY_2,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q4CY_2_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q4CY_2'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q4CY_2,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q1CY_1_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q1CY_1'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q1CY_1,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q2CY_1_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q2CY_1'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q2CY_1,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q3CY_1_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q3CY_1'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q3CY_1,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q4CY_1_C'
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q4CY_1'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q4CY_1,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q1CY_0_C'
        AND qtr_flag             IS NULL
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q1CY_0'
        AND qtr_flag                          IS NULL
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q1CY_0,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q2CY_0_C'
        AND qtr_flag             IS NULL
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q2CY_0'
        AND qtr_flag                          IS NULL
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q2CY_0,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q3CY_0_C'
        AND qtr_flag             IS NULL
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q3CY_0'
        AND qtr_flag                          IS NULL
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q3CY_0,
      SUM(
      CASE
        WHEN xgcc.cost_element_1 IN ('xx','xx not on xx')
        AND p.period              = 'Q4CY_0_C'
        AND qtr_flag             IS NULL
        THEN NVL(b.period_net_dr, 0)           - NVL(b.period_net_cr, 0)
        WHEN NVL(xgcc.cost_element_1,'X') NOT IN ('xx','xx not on xx')
        AND p.period                           = 'Q4CY_0'
        AND qtr_flag                          IS NULL
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) Q4CY_0,
      SUM(
      CASE
        WHEN p.period = 'CM_5'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) CM_5,
      SUM(
      CASE
        WHEN p.period = 'CM_4'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) CM_4,
      SUM(
      CASE
        WHEN p.period = 'CM_3'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) CM_3,
      SUM(
      CASE
        WHEN p.period = 'CM_2'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) CM_2,
      SUM(
      CASE
        WHEN p.period = 'CM_1'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) CM_1,
      SUM(
      CASE
        WHEN p.period = 'CM_0'
        THEN NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)
        ELSE 0
      END) CM
    FROM
      (SELECT /*+ full(b) parallel (b,4) */ b.currency_code,
        b.period_net_dr,
        b.period_net_cr,
        b.period_name,
        b.code_combination_id
      FROM apps.xx_gl_balances b
      WHERE b.actual_flag                                      = 'A'
      AND b.ledger_id                                          = 2235.1
      AND (NVL(b.period_net_dr, 0) - NVL(b.period_net_cr, 0)) <> 0
      AND b.translated_flag                                   IS NULL
      ) b,
      (SELECT 'CM_'
        || (month_num - 1) period,
        period_name period_name,
        ledger_name,
        ledger_id,
        NULL qtr_flag
      FROM
        (SELECT gph.period_name,
          (row_number() over(order by gph.start_date DESC)) month_num,
          ledger_name,
          ledger_id
        FROM
          (SELECT gp.Period_Set_Name,
            gp.Period_Name,
            gp.Period_Year,
            gp.Start_Date,
            gp.End_Date,
            gl.name ledger_name,
            gl.ledger_id
          FROM apps.gl_periods gp,
            apps.gl_ledgers gl
          WHERE gl.period_set_name = gp.period_set_name
          AND gl.name              = 'USD CL'
          ) gp,
          apps.gl_periods gph
        WHERE gp.period_set_name        = gph.period_set_name
        AND gph.start_date             <= gp.start_date
          START WITH gp.period_name     ='MAY-21'
          CONNECT BY prior gph.end_date = gp.start_date
        ORDER BY gph.start_date DESC
        ) t
      WHERE month_num <= 6
      UNION ALL
      SELECT 'Q'
        || gph.quarter_num
        || 'CY_'
        || (gp.period_year - gph.period_year),
        gph.period_name,
        gl.name,
        gl.ledger_id,
        CASE
          WHEN (gp.period_year = gph.period_year
          AND gph.period_num   > gp.period_num)
          THEN 'N'
          ELSE NULL
        END Qtr_flag
      FROM apps.gl_periods gp,
        apps.gl_periods gph,
        apps.gl_ledgers gl
      WHERE gl.period_set_name = gph.period_set_name
      AND gl.period_set_name   = gp.period_set_name
      AND gl.name              = 'USD CL'
      AND gp.period_name       ='MAY-21'
      AND (gph.period_year    >= gp.period_year - 2
      AND gph.period_year     <= gp.period_year)
      UNION ALL
      SELECT 'Q'
        || gph.quarter_num
        || 'CY_'
        || (gp.period_year - gph.period_year)
        || '_C' period,
        CASE
          WHEN gph.quarter_num = gp.quarter_num
          AND gph.period_year  = gp.period_year
          THEN gp.period_name
          ELSE gph.period_name
        END period_name,
        gl.name ledger_name,
        gl.ledger_id,
        CASE
          WHEN (gp.period_year = gph.period_year
          AND gph.Quarter_num  > gp.Quarter_num)
          THEN 'N'
          ELSE NULL
        END Qtr_flag
      FROM apps.gl_periods gp,
        apps.gl_periods gph,
        (SELECT MAX(start_date) start_date,
          quarter_num,
          period_year,
          period_set_name
        FROM apps.gl_periods gp
        GROUP BY quarter_num,
          period_year,
          period_set_name
        ) max_gp,
        apps.gl_ledgers gl
      WHERE gl.period_set_name = max_gp.period_set_name
      AND gl.period_set_name   = gph.period_set_name
      AND gl.period_set_name   = gp.period_set_name
      AND gl.name              = 'USD CL'
      AND gp.period_name       ='MAY-21'
      AND (gph.period_year    >= gp.period_year - 2
      AND gph.period_year     <= gp.period_year)
      AND gph.start_date       = max_gp.start_date
      ) p,
      apps.xx_GL_FS_GLCC_ATTR_pl xgcc,
      (SELECT distinct NVL(ffvv.description, ffvv.flex_value) description,
        ffvv.flex_value
        -- substr(ffvv.compiled_value_attributes, 5, 1) gl_account_type
      FROM apps.fnd_flex_value_sets ffvs,
        apps.fnd_flex_values_vl ffvv
      WHERE ffvs.flex_value_set_name = 'xx_GL_GLOBAL_ACCT'
      AND ffvs.flex_value_set_id     = ffvv.flex_value_set_id
      ) acct_flex,
      (SELECT distinct NVL(ffvv.description, ffvv.flex_value) description,
        ffvv.flex_value
      FROM apps.fnd_flex_value_sets ffvs,
        apps.fnd_flex_values_vl ffvv
      WHERE ffvs.flex_value_set_name = 'xx_GL_CO'
      AND ffvs.flex_value_set_id     = ffvv.flex_value_set_id
      ) co_flex,
      (SELECT distinct NVL(ffvv.description, ffvv.flex_value) description,
        ffvv.flex_value
      FROM apps.fnd_flex_value_sets ffvs,
        apps.fnd_flex_values_vl ffvv
      WHERE ffvs.flex_value_set_name = 'xx_GL_BU'
      AND ffvs.flex_value_set_id     = ffvv.flex_value_set_id
      ) bu_flex,
      apps.fnd_user fu
    WHERE p.period_name          = b.period_name(+)
    AND xgcc.code_combination_id = b.code_combination_id --(+)
    AND fu.user_name(+)          = xgcc.controller
    AND co_flex.flex_value       = xgcc.segment1
    AND acct_flex.flex_value     = xgcc.segment2
    AND bu_flex.flex_value       = xgcc.segment7
    AND ((b.currency_code        = 'STAT'
    AND xgcc.segment2 BETWEEN '90110' AND '90210')
    OR (b.currency_code      <> 'STAT'
    AND xgcc.gl_account_type IN ('E', 'R')))
    GROUP BY xgcc.segment1,
      co_flex.description,
      xgcc.segment2,
      acct_flex.description,
      xgcc.segment3,
      xgcc.segment5,
      xgcc.segment7,
      bu_flex.description,
      xgcc.dept_function,
      SUBSTR(xgcc.segment4,1,2),
      xgcc.region,
      xgcc.country,
      xgcc.fs_cat_1,
      xgcc.fs_cat_2,
      xgcc.fs_cat_3,
      xgcc.cost_element_1,
      xgcc.cost_element_2,
      xgcc.pnl_line_summary,
      xgcc.mda_category,
      xgcc.nongaap,
      xgcc.business_group,
      xgcc.reporting_unit,
      xgcc.gng,
      xgcc.status,
      xgcc.le_type,
      -- xgcc.controller,
      fu.description,
      xgcc.top_co_group,
      xgcc.co_group,
      b.currency_code,
      xgcc.short_name,
      xgcc.gl_account_type
    ) t
  WHERE t.q1cy_2 <> 0
  OR t.q2cy_2    <> 0
  OR t.q3cy_2    <> 0
  OR t.q4cy_2    <> 0
  OR t.q4cy_2    <> 0
  OR t.q1cy_1    <> 0
  OR t.q2cy_1    <> 0
  OR t.q3cy_1    <> 0
  OR t.q4cy_1    <> 0
  OR t.q4cy_1    <> 0
  OR t.q1cy_0    <> 0
  OR t.q2cy_0    <> 0
  OR t.q3cy_0    <> 0
  OR t.q4cy_0    <> 0
  OR t.q4cy_0    <> 0
  OR t.cm_5      <> 0
  OR t.cm_4      <> 0
  OR t.cm_3      <> 0
  OR t.cm_2      <> 0
  OR t.cm_1      <> 0
  OR t.cm        <> 0
  GROUP BY t.co,
    t.co_desc,
    t.short_name,
    t.gac,
    t.gac_description,
    t.gac_type,
    t.lac,
    t.ico,
    t.bu,
    t.bu_description,
    t.dept_function,
    t.dept_func_cd,
    t.region,
    t.country,
    t.fs_cat_1,
    t.fs_cat_2,
    t.fs_cat_3,
    t.cost_element_1,
    t.cost_element_2,
    t.pnl_line_summary,
    t.mda_category,
    t.nongaap_pnl,
    t.business_group,
    t.reporting_unit,
    t.gng,
    t.top_co_grp,
    t.co_grp,
    t.le_type,
    t.controller,
    t.status,
    t.currency_code
  ) t
  where rownum < 150000

call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.15       0.15          0          7          0           0
Execute      1      0.11       0.11          0        807          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total        2      0.26       0.26          0        814          0           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 173  (APPS)

Rows     Execution Plan
-------  ---------------------------------------------------
      0  SELECT STATEMENT   MODE: ALL_ROWS
      0   COUNT (STOPKEY)
      0    PX COORDINATOR
      0     PX SEND (QC (RANDOM)) OF ':TQ10006' [:Q1006]
      0      COUNT (STOPKEY) [:Q1006]
      0       VIEW [:Q1006]
      0        SORT (GROUP BY STOPKEY) [:Q1006]
      0         PX RECEIVE [:Q1006]
      0          PX SEND (HASH) OF ':TQ10005' [:Q1005]
      0           HASH (GROUP BY) [:Q1005]
      0            VIEW [:Q1005]
      0             FILTER [:Q1005]
      0              HASH (GROUP BY) [:Q1005]
      0               PX RECEIVE [:Q1005]
      0                PX SEND (HASH) OF ':TQ10004' [:Q1004]
      0                 HASH (GROUP BY) [:Q1004]
      0                  HASH JOIN (RIGHT OUTER) [:Q1004]
      0                   BUFFER (SORT) [:Q1004]
      0                    PX RECEIVE [:Q1004]
      0                     PX SEND (HYBRID HASH) OF 
                                ':TQ10001'
      0                      STATISTICS COLLECTOR
      0                       TABLE ACCESS   MODE: 
                                  ANALYZED (FULL) OF 'FND_USER' (TABLE)
      0                   PX RECEIVE [:Q1004]
      0                    PX SEND (HYBRID HASH) OF 
                               ':TQ10003' [:Q1003]
      0                     HASH JOIN [:Q1003]
      0                      BUFFER (SORT) [:Q1003]
      0                       PX RECEIVE [:Q1003]
      0                        PX SEND (BROADCAST) OF 
                                   ':TQ10000'
      0                         VIEW
      0                          UNION-ALL
      0                           VIEW
      0                            WINDOW (SORT 
                                       PUSHED RANK)
      0                             CONNECT BY 
                                        (NO FILTERING WITH START-WITH)
      0                              HASH JOIN
      0                               NESTED 
                                          LOOPS
      0                                TABLE 
                                         ACCESS   MODE: ANALYZED (BY INDEX 
                                           ROWID) OF 'GL_LEDGERS' (TABLE)
      0                                 
                                          INDEX   MODE: ANALYZED (UNIQUE 
                                          SCAN) OF 'GL_LEDGERS_U1' (INDEX 
                                            (UNIQUE))
      0                                TABLE 
                                         ACCESS   MODE: ANALYZED (BY INDEX 
                                         ROWID BATCHED) OF 'GL_PERIODS' 
                                           (TABLE)
      0                                 
                                          INDEX   MODE: ANALYZED (RANGE 
                                          SCAN) OF 'GL_PERIODS_U2' (INDEX 
                                            (UNIQUE))
      0                               TABLE 
                                        ACCESS   MODE: ANALYZED (FULL) OF 
                                          'GL_PERIODS' (TABLE)
      0                           NESTED LOOPS
      0                            NESTED LOOPS
      0                             TABLE ACCESS 
                                        MODE: ANALYZED (BY INDEX ROWID) OF 
                                        'GL_LEDGERS' (TABLE)
      0                              INDEX   
                                       MODE: ANALYZED (UNIQUE SCAN) OF 
                                         'GL_LEDGERS_U1' (INDEX (UNIQUE))
      0                             TABLE ACCESS 
                                        MODE: ANALYZED (BY INDEX ROWID) OF 
                                        'GL_PERIODS' (TABLE)
      0                              INDEX   
                                       MODE: ANALYZED (UNIQUE SCAN) OF 
                                         'GL_PERIODS_U1' (INDEX (UNIQUE))
      0                            TABLE ACCESS   
                                     MODE: ANALYZED (BY INDEX ROWID BATCHED)
                                        OF 'GL_PERIODS' (TABLE)
      0                             INDEX   
                                      MODE: ANALYZED (RANGE SCAN) OF 
                                        'GL_PERIODS_U2' (INDEX (UNIQUE))
      0                           FILTER
      0                            HASH (GROUP BY)

      0                             HASH JOIN
      0                              NESTED 
                                         LOOPS
      0                               NESTED 
                                          LOOPS
      0                                TABLE 
                                         ACCESS   MODE: ANALYZED (BY INDEX 
                                           ROWID) OF 'GL_LEDGERS' (TABLE)
      0                                 
                                          INDEX   MODE: ANALYZED (UNIQUE 
                                          SCAN) OF 'GL_LEDGERS_U1' (INDEX 
                                            (UNIQUE))
      0                                TABLE 
                                         ACCESS   MODE: ANALYZED (BY INDEX 
                                           ROWID) OF 'GL_PERIODS' (TABLE)
      0                                 
                                          INDEX   MODE: ANALYZED (UNIQUE 
                                          SCAN) OF 'GL_PERIODS_U1' (INDEX 
                                            (UNIQUE))
      0                               TABLE 
                                        ACCESS   MODE: ANALYZED (BY INDEX 
                                        ROWID BATCHED) OF 'GL_PERIODS' 
                                          (TABLE)
      0                                INDEX  
                                          MODE: ANALYZED (RANGE SCAN) OF 
                                           'GL_PERIODS_U2' (INDEX (UNIQUE))
      0                              TABLE 
                                       ACCESS   MODE: ANALYZED (FULL) OF 
                                         'GL_PERIODS' (TABLE)
      0                      HASH JOIN [:Q1003]
      0                       JOIN FILTER (CREATE) OF 
                                  ':BF0000' [:Q1003]
      0                        PX RECEIVE [:Q1003]
      0                         PX SEND (BROADCAST) 
                                    OF ':TQ10002' [:Q1002]
      0                          PX SELECTOR 
                                     [:Q1002]
      0                           HASH JOIN 
                                      [:Q1002]
      0                            VIEW [:Q1002]
      0                             HASH (UNIQUE)
                                         [:Q1002]
      0                              NESTED 
                                         LOOPS [:Q1002]
      0                               NESTED 
                                          LOOPS [:Q1002]
      0                                NESTED 
                                           LOOPS [:Q1002]
      0                                 
                                          TABLE ACCESS   MODE: ANALYZED (BY 
                                          INDEX ROWID) OF 'FND_FLEX_VALUE_S
                                            ETS' (TABLE) [:Q1002]
      0                                  
                                           INDEX   MODE: ANALYZED (UNIQUE 
                                           SCAN) OF 'FND_FLEX_VALUE_SETS_U2
                                             ' (INDEX (UNIQUE)) [:Q1002]
      0                                 
                                          TABLE ACCESS   MODE: ANALYZED (BY 
                                          INDEX ROWID BATCHED) OF 
                                          'FND_FLEX_VALUES' (TABLE) [:Q1002]

      0                                  
                                           INDEX   MODE: ANALYZED (RANGE 
                                           SCAN) OF 'FND_FLEX_VALUES_N2' 
                                             (INDEX) [:Q1002]
      0                                INDEX  
                                          MODE: ANALYZED (UNIQUE SCAN) OF 
                                         'FND_FLEX_VALUES_TL_U1' (INDEX 
                                           (UNIQUE)) [:Q1002]
      0                               TABLE 
                                        ACCESS   MODE: ANALYZED (BY INDEX 
                                        ROWID) OF 'FND_FLEX_VALUES_TL' 
                                          (TABLE) [:Q1002]
      0                            HASH JOIN 
                                       [:Q1002]
      0                             VIEW [:Q1002]

      0                              HASH 
                                         (UNIQUE) [:Q1002]
      0                               NESTED 
                                          LOOPS [:Q1002]
      0                                NESTED 
                                           LOOPS [:Q1002]
      0                                 
                                            NESTED LOOPS [:Q1002]
      0                                  
                                           TABLE ACCESS   MODE: ANALYZED 
                                           (BY INDEX ROWID) OF 'FND_FLEX_VA
                                             LUE_SETS' (TABLE) [:Q1002]
      0                                   
                                            INDEX   MODE: ANALYZED (UNIQUE 
                                            SCAN) OF 'FND_FLEX_VALUE_SETS_U
                                              2' (INDEX (UNIQUE)) [:Q1002]
      0                                  
                                           TABLE ACCESS   MODE: ANALYZED 
                                           (BY INDEX ROWID BATCHED) OF 
                                           'FND_FLEX_VALUES' (TABLE) 
                                             [:Q1002]
      0                                   
                                            INDEX   MODE: ANALYZED (RANGE 
                                            SCAN) OF 'FND_FLEX_VALUES_N2' 
                                              (INDEX) [:Q1002]
      0                                 
                                          INDEX   MODE: ANALYZED (UNIQUE 
                                          SCAN) OF 'FND_FLEX_VALUES_TL_U1' 
                                            (INDEX (UNIQUE)) [:Q1002]
      0                                TABLE 
                                         ACCESS   MODE: ANALYZED (BY INDEX 
                                         ROWID) OF 'FND_FLEX_VALUES_TL' 
                                           (TABLE) [:Q1002]
      0                             HASH JOIN 
                                        [:Q1002]
      0                              VIEW 
                                         [:Q1002]
      0                               HASH 
                                          (UNIQUE) [:Q1002]
      0                                NESTED 
                                           LOOPS [:Q1002]
      0                                 
                                            NESTED LOOPS [:Q1002]
      0                                  
                                             NESTED LOOPS [:Q1002]
      0                                   
                                            TABLE ACCESS   MODE: ANALYZED 
                                            (BY INDEX ROWID) OF 'FND_FLEX_V
                                              ALUE_SETS' (TABLE) [:Q1002]
      0                                   
                                              INDEX   MODE: ANALYZED 
                                             (UNIQUE SCAN) OF 'FND_FLEX_VAL
                                             UE_SETS_U2' (INDEX (UNIQUE)) 
                                               [:Q1002]
      0                                   
                                            TABLE ACCESS   MODE: ANALYZED 
                                            (BY INDEX ROWID BATCHED) OF 
                                            'FND_FLEX_VALUES' (TABLE) 
                                              [:Q1002]
      0                                   
                                              INDEX   MODE: ANALYZED (RANGE 
                                             SCAN) OF 'FND_FLEX_VALUES_N2' 
                                               (INDEX) [:Q1002]
      0                 

Connor McDonald
August 05, 2021 - 3:27 am UTC

You gave us everything *except* the wait information :-) which is what we need to see (between the two environments).

De-dup is a SQLNet feature, eg an ordered set of results, eg

Invoice1,
Invoice1,
Invoice1,
Invoice1,
Invoice2,
Invoice2
Invoice2,
Invoice3

will be sent logically across the network as:

Invoice1 (cnt=4)
Invoice2 (cnt=2)
Invoice3 (cnt=1)

The same data unordered:

Invoice1,
Invoice1,
Invoice2,
Invoice1,
Invoice1,
Invoice2,
Invoice3
Invoice2

would be sent


Invoice1, (cnt=2)
Invoice2,(cnt=1)
Invoice1, (cnt=2)
Invoice2,(cnt=1)
Invoice3 (cnt=1)
Invoice2 (cnt=1)

Ambuj Kumar, August 04, 2021 - 8:55 pm UTC

tkprof got cut off. Pasting rest here.
    
                                          INDEX   MODE: ANALYZED (UNIQUE 
                                          SCAN) OF 'FND_FLEX_VALUES_TL_U1' 
                                            (INDEX (UNIQUE)) [:Q1002]
      0                                TABLE 
                                         ACCESS   MODE: ANALYZED (BY INDEX 
                                         ROWID) OF 'FND_FLEX_VALUES_TL' 
                                           (TABLE) [:Q1002]
      0                             HASH JOIN 
                                        [:Q1002]
      0                              VIEW 
                                         [:Q1002]
      0                               HASH 
                                          (UNIQUE) [:Q1002]
      0                                NESTED 
                                           LOOPS [:Q1002]
      0                                 
                                            NESTED LOOPS [:Q1002]
      0                                  
                                             NESTED LOOPS [:Q1002]
      0                                   
                                            TABLE ACCESS   MODE: ANALYZED 
                                            (BY INDEX ROWID) OF 'FND_FLEX_V
                                              ALUE_SETS' (TABLE) [:Q1002]
      0                                   
                                              INDEX   MODE: ANALYZED 
                                             (UNIQUE SCAN) OF 'FND_FLEX_VAL
                                             UE_SETS_U2' (INDEX (UNIQUE)) 
                                               [:Q1002]
      0                                   
                                            TABLE ACCESS   MODE: ANALYZED 
                                            (BY INDEX ROWID BATCHED) OF 
                                            'FND_FLEX_VALUES' (TABLE) 
                                              [:Q1002]
      0                                   
                                              INDEX   MODE: ANALYZED (RANGE 
                                             SCAN) OF 'FND_FLEX_VALUES_N2' 
                                               (INDEX) [:Q1002]
      0                                  
                                           INDEX   MODE: ANALYZED (UNIQUE 
                                           SCAN) OF 'FND_FLEX_VALUES_TL_U1' 
                                             (INDEX (UNIQUE)) [:Q1002]
      0                                 
                                          TABLE ACCESS   MODE: ANALYZED (BY 
                                          INDEX ROWID) OF 'FND_FLEX_VALUES_
                                            TL' (TABLE) [:Q1002]
      0                              TABLE 
                                       ACCESS   MODE: ANALYZED (FULL) OF 
                                       'XXON_GL_FS_GLCC_ATTR_PLOPR' (TABLE) 
                                         [:Q1002]
      0                       JOIN FILTER (USE) OF 
                                  ':BF0000' [:Q1003]
      0                        PX BLOCK (ITERATOR) 
                                   [:Q1003]
      0                         TABLE ACCESS   MODE: 
                                  ANALYZED (FULL) OF 'XXON_GL_BALANCES' 
                                    (TABLE) [:Q1003]


Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  PGA memory operation                          434        0.00          0.00
  reliable message                                2        0.00          0.00
  SQL*Net message to client                       1        0.00          0.00
  SQL*Net message from client                     1        0.12          0.12
  Disk file operations I/O                       48        0.00          0.00
  db file sequential read                         5        0.00          0.00
  ASM IO for non-blocking poll                63811        0.00          0.18
  db file parallel read                           5        0.00          0.00
  direct path read                            18781        0.01          2.59
********************************************************************************

Connor McDonald
August 05, 2021 - 3:29 am UTC

Ah...ignore my previous comment about missing waits :-)

I'm a little lost though - this looks like a few seconds, not the minutes you referred to earlier?

Ambuj Kumar, August 04, 2021 - 9:34 pm UTC

Thank you Tyler we are on Oracle database and not on SQL Server.

Perhaps parallel sql ?!?!?!

Rajeshwaran Jeyabal, August 05, 2021 - 8:09 am UTC

looks at this section of plan from trace
      0                        PX RECEIVE [:Q1003]
      0                         PX SEND (BROADCAST) 
                                    OF ':TQ10002' [:Q1002]
      0                          PX SELECTOR 
                                     [:Q1002]
      0                           HASH JOIN 

sounds like it was perhaps a parallel sql in place, dont we need a sql-monitor to validate the stuff rather than Tkprof ?
Connor McDonald
August 06, 2021 - 1:44 am UTC

Agreed.

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.