Re: Inefficient query plan using large in-list
From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 16 May 2019 16:21:56 +0000
Message-ID: <LO2P265MB0415C450123F47C520DA8AF6A50A0_at_LO2P265MB0415.GBRP265.PROD.OUTLOOK.COM>
Date: Thu, 16 May 2019 16:21:56 +0000
Message-ID: <LO2P265MB0415C450123F47C520DA8AF6A50A0_at_LO2P265MB0415.GBRP265.PROD.OUTLOOK.COM>
The optimizer is not pushing the predicate into the view and does a full scan on the MV causing performance issue!
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |IN-OUT| --------------------------------------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 387K| 1653M| | 17M (1)| 00:11:12 | | | |
| 1 | MERGE JOIN | | 387K| 1653M| | 17M (1)| 00:11:12 | | | |
|* 2 | VIEW | SECMASTER_HISTORY | 47M| 199G| | 17M (1)| 00:11:12 | | | |
| 3 | WINDOW SORT | | 47M| 71G| 91G| 17M (1)| 00:11:12 | | | |
| 4 | PARTITION RANGE ALL | | 47M| 71G| | 1209K (1)| 00:00:48 | 1 |1048575| |
|* 5 | MAT_VIEW ACCESS FULL | SECMASTER_HISTORY_MV | 47M| 71G| | 1209K (1)| 00:00:48 | 1 |1048575| | |* 6 | SORT JOIN | | 8168 | 16336 | | 30 (4)| 00:00:01 | | | |
| 7 | COLLECTION ITERATOR SUBQUERY FETCH| | 8168 | 16336 | | 29 (0)| 00:00:01 | | | |
|* 8 | CONNECT BY WITHOUT FILTERING | | | | | | | | | PCWP |
| 9 | FAST DUAL | | 1 | | | 2 (0)| 00:00:01 | | | PCWP |
--------------------------------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
2 - filter("EFFECTIVE_DATE"<=TO_DATE('15-MAY-2010') AND NVL("EXPIRATION_DATE",SYSDATE_at_!)>=TO_DATE('15-MAY-2010'))
5 - filter("SRC_INTFC_INST"=4)
6 - access("SH"."SECURITY_ALIAS"=VALUE(KOKBF$))
filter("SH"."SECURITY_ALIAS"=VALUE(KOKBF$))
8 - filter(LEVEL<=LENGTH( REGEXP_REPLACE (:IN_LIST,'[^,]+'))+1)
25 rows selected.
I tried to hint the optimizer but nothing works :-(
Any help is highly appreciated!
Thanks in advance for your help!
Senthil
-- http://www.freelists.org/webpage/oracle-lReceived on Thu May 16 2019 - 18:21:56 CEST