RE: Query performance issue after 19c upgrade

  • From: Noveljic Nenad <nenad.noveljic@xxxxxxxxxxxx>
  • To: Michael Schmitt <mschmitt@xxxxxxxxxxxx>, "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 25 Jun 2020 19:20:39 +0000

Hi Mike,

In both plans there is lateral subquery. But in a good plan there is a join 
predicate pushdown inside (JPPD) the lateral view:

JPPD: Checking validity of push-down in query block SEL$3A3601C0 (#8)
JPPD:   Checking validity of push-down from query block SEL$3A3601C0 (#8) to 
query block SEL$2 (#14)
Check Basic Validity for Non-Union View for query block SEL$2 (#14)
JPPD:     Passed validity checks

It seems it was intentionally forbidden 19c:

JPPD:   Checking validity of push-down from query block SEL$3A3601C0 (#8) to 
query block SEL$2 (#14)
Check Basic Validity for Non-Union View for query block SEL$2 (#14)
JPPD:     JPPD bypassed: View is lateral outer-joined.

This was probably done to prevent wrong results: Bug 23273859 : WRONG RESULT 
WITH JOIN PREDICATE PUSH DOWN INTO A VIEW.

Igor Usoltsev hit the same issue and found the fix (see 
https://igorusoltsev.wordpress.com/2020/05/11/12-1-0-2-18c-upgrade-quiz-jppd-bypassed-view-is-lateral-outer-joined/
 ): Bug 30786641 : QUERY PERFORMANCE REGRESSION AFTER UPGRADING FROM 11.2.0.4 
TO 19.5

Could you apply the patch for Bug 30786641 : QUERY PERFORMANCE REGRESSION AFTER 
UPGRADING FROM 11.2.0.4 TO 19.5

Best regards,

Nenad

https://nenadnoveljic.com/blog/



From: Michael Schmitt <mschmitt@xxxxxxxxxxxx>
Sent: Donnerstag, 25. Juni 2020 18:33
To: Noveljic Nenad <nenad.noveljic@xxxxxxxxxxxx>; oracle-l@xxxxxxxxxxxxx
Subject: RE: Query performance issue after 19c upgrade

Hi Nenad,

We have tried the two fix controls that were different between 12.2 and 19c but 
it did not make a difference.  We are trying to test some related to predicates 
as well just in case.  The DCL output is exactly the same from both.  I am 
trying to find the relevant query block information from the trace.  That part 
is a bit over my head so trying to figure out how to grab that relevant info


DCL: Checking validity of lateral view decorrelation SEL$3A3601C0 (#1)
DCL: Bypassed: view's subquery has invalid correlation.
DCL: Failed decorrelation validity for lateral view block SEL$3A3601C0 (#1)
DCL: Checking validity of group-by elimination SEL$25 (#7)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$FFAA604D (#6)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$28 (#5)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$29 (#4)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$30 (#3)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$31 (#2)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$E5368E0D (#12)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$DB783706 (#11)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$293B4D0C (#10)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$18 (#9)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$11 (#13)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$A0F731F2 (#17)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$50F95EF3 (#16)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$FCB737BA (#15)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$2 (#14)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$3A3601C0 (#8)
DCL: Result of group-by elimination: Invalid
DCL: Checking validity of group-by elimination SEL$50BF5838 (#1)
DCL: Result of group-by elimination: Invalid

GOOD Plan:
| 75  |      VIEW                                         | VW_LAT_84AD8559   | 
    1 |     7 |    20 |  00:00:01 |
| 76  |       NESTED LOOPS                                |                   | 
    1 |    31 |    17 |  00:00:01 |
| 77  |        TABLE ACCESS BY INDEX ROWID BATCHED        | PS_NAMES          | 
    1 |    29 |     4 |  00:00:01 |
| 78  |         INDEX RANGE SCAN                          | PS_NAMES          | 
    1 |       |     3 |  00:00:01 |
| 79  |          SORT AGGREGATE                           |                   | 
    1 |    22 |       |           |
| 80  |           FIRST ROW                               |                   | 
    1 |    22 |     3 |  00:00:01 |
| 81  |            INDEX RANGE SCAN (MIN/MAX)             | PS_NAMES          | 
    1 |    22 |     3 |  00:00:01 |
| 82  |        VIEW PUSHED PREDICATE                      | PS_PERALL_SEC_QRY | 
    1 |     2 |    13 |  00:00:01 |
| 83  |         SORT UNIQUE                               |                   | 
    1 |    52 |    13 |  00:00:01 |
| 84  |          FILTER                                   |                   | 
      |       |       |           |
| 85  |           NESTED LOOPS                            |                   | 
    1 |    52 |     5 |  00:00:01 |
| 86  |            TABLE ACCESS BY INDEX ROWID            | PSOPRDEFN         | 
    1 |    24 |     2 |  00:00:01 |
| 87  |             INDEX UNIQUE SCAN                     | PS_PSOPRDEFN      | 
    1 |       |     1 |  00:00:01 |
| 88  |            TABLE ACCESS BY INDEX ROWID BATCHED    | PS_SJT_PERSON     | 
    1 |    28 |     3 |  00:00:01 |
| 89  |             INDEX RANGE SCAN                      | PSASJT_PERSON     | 
    1 |       |     2 |  00:00:01 |
| 90  |           NESTED LOOPS                            |                   | 
    1 |    63 |     7 |  00:00:01 |
86 - SEL$639F1A6F         / OPR@SEL$2
87 - SEL$639F1A6F         / OPR@SEL$2
88 - SEL$639F1A6F         / SEC@SEL$2
89 - SEL$639F1A6F         / SEC@SEL$2


BAD Plan:
| 61  |     BUFFER SORT                                  |                   |  
   1 |     7 |  6269 |  00:01:16 |
| 62  |      VIEW                                        | VW_LAT_84AD8559   |  
   1 |     7 |  6226 |  00:01:15 |
| 63  |       MERGE JOIN                                 |                   |  
   1 |    53 |  6223 |  00:01:15 |
| 64  |        VIEW                                      | PS_PERALL_SEC_QRY |  
312K | 7499K |  6218 |  00:01:15 |
| 65  |         SORT UNIQUE                              |                   |  
312K |   16M |  6218 |  00:01:15 |
| 66  |          FILTER                                  |                   |  
     |       |       |           |
| 67  |           NESTED LOOPS                           |                   |  
442K |   22M |  1603 |  00:00:20 |
| 68  |            TABLE ACCESS BY INDEX ROWID           | PSOPRDEFN         |  
   1 |    24 |     2 |  00:00:01 |
| 69  |             INDEX UNIQUE SCAN                    | PS_PSOPRDEFN      |  
   1 |       |     1 |  00:00:01 |
| 70  |            TABLE ACCESS FULL                     | PS_SJT_PERSON     |  
442K |   12M |  1601 |  00:00:20 |
64 - SEL$2                / "I1"@"SEL$1"
65 - SEL$2
68 - SEL$2                / "OPR"@"SEL$2"
69 - SEL$2                / "OPR"@"SEL$2"
70 - SEL$2                / "SEC"@"SEL$2"

Thanks


From: Noveljic Nenad 
<nenad.noveljic@xxxxxxxxxxxx<mailto:nenad.noveljic@xxxxxxxxxxxx>>
Sent: Thursday, June 25, 2020 3:37 AM
To: Michael Schmitt <mschmitt@xxxxxxxxxxxx<mailto:mschmitt@xxxxxxxxxxxx>>; 
oracle-l@xxxxxxxxxxxxx<mailto:oracle-l@xxxxxxxxxxxxx>
Subject: RE: Query performance issue after 19c upgrade

Hi Mike,

Two ideas:


  1.  Which relevant bug fixes are different in both releases?

select *   from v$system_fix_control where lower(description) like '%lateral%' ;

I'd try implement the 12c configuration on 19c - on the session level, just to 
test.
  2.  Compare DCL transformations in both releases:

grep DCL cbo.trc

Could you post the output together with the relevant parts of the execution 
plan and the query block information?

Best regards,

Nenad

http://nenadnoveljic.com/blog/<https://urldefense.com/v3/__http:/nenadnoveljic.com/blog/__;!!BpyFHLRN4TMTrA!qNxxrFeAr3Wa3ymCH08T9MqVr3BTyNYz9jrmue1eRTbDhofxp6JgDEXrCEYYl-OlfEA$>


From: Michael Schmitt <mschmitt@xxxxxxxxxxxx<mailto:mschmitt@xxxxxxxxxxxx>>
Sent: Mittwoch, 24. Juni 2020 23:05
To: Noveljic Nenad 
<nenad.noveljic@xxxxxxxxxxxx<mailto:nenad.noveljic@xxxxxxxxxxxx>>; 
oracle-l@xxxxxxxxxxxxx<mailto:oracle-l@xxxxxxxxxxxxx>
Subject: RE: Query performance issue after 19c upgrade

Hi Nenad,

I do not find the term "non-well" anywhere in the 10053 trace

Thanks,
Mike

From: oracle-l-bounce@xxxxxxxxxxxxx<mailto:oracle-l-bounce@xxxxxxxxxxxxx
<oracle-l-bounce@xxxxxxxxxxxxx<mailto:oracle-l-bounce@xxxxxxxxxxxxx>> On Behalf 
Of Noveljic Nenad
Sent: Wednesday, June 24, 2020 3:53 PM
To: Michael Schmitt <mschmitt@xxxxxxxxxxxx<mailto:mschmitt@xxxxxxxxxxxx>>; 
oracle-l@xxxxxxxxxxxxx<mailto:oracle-l@xxxxxxxxxxxxx>
Subject: RE: Query performance issue after 19c upgrade

Do you see "DCL: Bypassed: view has non-well-formed predicate" in the optimizer 
trace?

Best regards,

Nenad

http://nenadnoveljic.com/blog/<https://urldefense.com/v3/__http:/nenadnoveljic.com/blog/__;!!BpyFHLRN4TMTrA!qNxxrFeAr3Wa3ymCH08T9MqVr3BTyNYz9jrmue1eRTbDhofxp6JgDEXrCEYYl-OlfEA$>
____________________________________________________
Please consider the environment before printing this e-mail.
Bitte denken Sie an die Umwelt, bevor Sie dieses E-Mail drucken.

Important Notice

This message is intended only for the individual named. It may contain 
confidential or privileged information. If you are not the named addressee you 
should in particular not disseminate, distribute, modify or copy this e-mail. 
Please notify the sender immediately by e-mail, if you have received this 
message by mistake and delete it from your system.
Without prejudice to any contractual agreements between you and us which shall 
prevail in any case, we take it as your authorization to correspond with you by 
e-mail if you send us messages by e-mail. However, we reserve the right not to 
execute orders and instructions transmitted by e-mail at any time and without 
further explanation.
E-mail transmission may not be secure or error-free as information could be 
intercepted, corrupted, lost, destroyed, arrive late or incomplete. Also 
processing of incoming e-mails cannot be guaranteed. All liability of Vontobel 
Holding Ltd. and any of its affiliates (hereinafter collectively referred to as 
"Vontobel Group") for any damages resulting from e-mail use is excluded. You 
are advised that urgent and time sensitive messages should not be sent by 
e-mail and if verification is required please request a printed version.
Please note that all e-mail communications to and from the Vontobel Group are 
subject to electronic storage and review by Vontobel Group. Unless stated to 
the contrary and without prejudice to any contractual agreements between you 
and Vontobel Group which shall prevail in any case, e-mail-communication is for 
informational purposes only and is not intended as an offer or solicitation for 
the purchase or sale of any financial instrument or as an official confirmation 
of any transaction.
The legal basis for the processing of your personal data is the legitimate 
interest to develop a commercial relationship with you, as well as your consent 
to forward you commercial communications. You can exercise, at any time and 
under the terms established under current regulation, your rights. If you 
prefer not to receive any further communications, please contact your client 
relationship manager if you are a client of Vontobel Group or notify the 
sender. Please note for an exact reference to the affected group entity the 
corporate e-mail signature. For further information about data privacy at 
Vontobel Group please consult 
www.vontobel.com<https://urldefense.com/v3/__https:/www.vontobel.com__;!!BpyFHLRN4TMTrA!qNxxrFeAr3Wa3ymCH08T9MqVr3BTyNYz9jrmue1eRTbDhofxp6JgDEXrCEYYhf1tEoU$>.

Important Notice

This message is intended only for the individual named. It may contain 
confidential or privileged information. If you are not the named addressee you 
should in particular not disseminate, distribute, modify or copy this e-mail. 
Please notify the sender immediately by e-mail, if you have received this 
message by mistake and delete it from your system.
Without prejudice to any contractual agreements between you and us which shall 
prevail in any case, we take it as your authorization to correspond with you by 
e-mail if you send us messages by e-mail. However, we reserve the right not to 
execute orders and instructions transmitted by e-mail at any time and without 
further explanation.
E-mail transmission may not be secure or error-free as information could be 
intercepted, corrupted, lost, destroyed, arrive late or incomplete. Also 
processing of incoming e-mails cannot be guaranteed. All liability of Vontobel 
Holding Ltd. and any of its affiliates (hereinafter collectively referred to as 
"Vontobel Group") for any damages resulting from e-mail use is excluded. You 
are advised that urgent and time sensitive messages should not be sent by 
e-mail and if verification is required please request a printed version.
Please note that all e-mail communications to and from the Vontobel Group are 
subject to electronic storage and review by Vontobel Group. Unless stated to 
the contrary and without prejudice to any contractual agreements between you 
and Vontobel Group which shall prevail in any case, e-mail-communication is for 
informational purposes only and is not intended as an offer or solicitation for 
the purchase or sale of any financial instrument or as an official confirmation 
of any transaction.
The legal basis for the processing of your personal data is the legitimate 
interest to develop a commercial relationship with you, as well as your consent 
to forward you commercial communications. You can exercise, at any time and 
under the terms established under current regulation, your rights. If you 
prefer not to receive any further communications, please contact your client 
relationship manager if you are a client of Vontobel Group or notify the 
sender. Please note for an exact reference to the affected group entity the 
corporate e-mail signature. For further information about data privacy at 
Vontobel Group please consult 
www.vontobel.com<https://urldefense.com/v3/__https:/www.vontobel.com__;!!BpyFHLRN4TMTrA!rv0_GhktlV6tgM8SLipS3Y2u6SaMz4nDnZ0YweAxfbmhpiYmWSwkNzQAQETbthxI7WM$>.

<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">p { font-family: Arial;font-size:9pt }</style>
</head>
<body>
<p>
<br>Important Notice</br>
<br />
This message is intended only for the individual named. It may contain 
confidential or privileged information. If you are not the named addressee you 
should in particular not disseminate, distribute, modify or copy this e-mail. 
Please notify the sender immediately by e-mail, if you have received this 
message by mistake and delete it from your system.<br />
Without prejudice to any contractual agreements between you and us which shall 
prevail in any case, we take it as your authorization to correspond with you by 
e-mail if you send us messages by e-mail. However, we reserve the right not to 
execute orders and instructions transmitted by e-mail at any time and without 
further explanation.<br />
E-mail transmission may not be secure or error-free as information could be 
intercepted, corrupted, lost, destroyed, arrive late or incomplete. Also 
processing of incoming e-mails cannot be guaranteed. All liability of Vontobel 
Holding Ltd. and any of its affiliates (hereinafter collectively referred to as 
"Vontobel Group") for any damages resulting from e-mail use is excluded. You 
are advised that urgent and time sensitive messages should not be sent by 
e-mail and if verification is required please request a printed version.</br>
Please note that all e-mail communications to and from the Vontobel Group are 
subject to electronic storage and review by Vontobel Group. Unless stated to 
the contrary and without prejudice to any contractual agreements between you 
and Vontobel Group which shall prevail in any case, e-mail-communication is for 
informational purposes only and is not intended as an offer or solicitation for 
the purchase or sale of any financial instrument or as an official confirmation 
of any transaction.<br />
The legal basis for the processing of your personal data is the legitimate 
interest to develop a commercial relationship with you, as well as your consent 
to forward you commercial communications. You can exercise, at any time and 
under the terms established under current regulation, your rights. If you 
prefer not to receive any further communications, please contact your client 
relationship manager if you are a client of Vontobel Group or notify the sender.
Please note for an exact reference to the affected group entity the corporate 
e-mail signature.
For further information about data privacy at Vontobel Group please consult <a 
href="https://www.vontobel.com";>www.vontobel.com</a>.<br />
</p>
</body>
</html>

Other related posts: