Hello Steve,
OK, there are several important things based on your provided information.
(Estimated plans generated just by doing good old “explain plan for”)
If I take the query, replace the bind variables from the query with string
values and run it through SQLPLUS, it runs in about 0.7 seconds and returns
the expected values. If I instead leave the bind variables in the query, and
in SQLPLUS define variables and then assign values via exec :v1 :=
‘SOMEVALUE’, then it sits and spins 57 MINUTES before returning the exact
same result set.
This was not a problem with 12.1.0.2 SE2. I’m hoping that there’s an init
parameter or something that was new in the 12.2 engine from 12.1 that might
be causing the problem.
"Steve Wales (AddOns)" <steve.wales@xxxxxxxxxxxxx> hat am 26. November 2019--
um 02:23 geschrieben:
Sorry for the length of this up front. Trying to get as much relevant info
into the initial post as people might need to point me where I’m getting the
problem
I have an Oracle 18c (18.8 if it matters) Standard Edition 2 database on
Linux 7..
There’s a query from the ERP system that’s hanging the online screen and
getting http timeouts because it’s not completing in a timely fashion.
I pulled the text of the query from v$sqltext and the bind variables from
v$sql_bind_capture.
The query is searching a parts catalog for colloquial names for parts.
If I take the query, replace the bind variables from the query with string
values and run it through SQLPLUS, it runs in about 0.7 seconds and returns
the expected values.
If I instead leave the bind variables in the query, and in SQLPLUS define
variables and then assign values via exec :v1 := ‘SOMEVALUE’, then it sits
and spins 57 MINUTES before returning the exact same result set.
The execution plans change slightly but significantly as well.
The tables:
MSF100 is a stock catalog table. Contains all stock items that the business
catalogs across all properties
MSF170 is a table that busts up the global catalog among assorted business
units
MSF120 contains the colloquial names. If I search on “ACTUATOR” it can
return me all the stock codes that have “ACTUATOR” as a colloquial name.
I assume rownum <= 20 is specified because that’s how many rows fit on a
screen at a time.
select * from( select * from MSF100 CATALOG where (CATALOG.stock_code in
(select MSF170Rec.stock_code from MSF170 MSF170Rec, MSF100 MSF100Rec
where (MSF100Rec.stock_code = MSF170Rec.stock_code))) and ( exists (select 1
from MSF120 MSF120Rec where (MSF120Rec.colloq_code = CATALOG.stock_code
and MSF120Rec.colloq_name like '%ACTUATOR%' and MSF120Rec.colloq_type = 'S'
)) or exists (select 1 from MSF120 MSF120Rec
where (MSF120Rec.colloq_code = CATALOG.template_id and MSF120Rec.colloq_name
like '%ACTUATOR%' and MSF120Rec.colloq_type = 'I' )))
and (CATALOG.stock_status <> 'X' ) order by CATALOG.stock_code ) where ROWNUM
<= 20;
When using the static values (and I apologize in advance for what
proportional fonts do the formatting below)
(Estimated plans generated just by doing good old “explain plan for”)
This was not a problem with 12.1.0.2 SE2.
One last thing, since this is an ERP package, I can’t change the code /
insert hints / build new indexes (well I suppose I could do that but the next
release upgrade would blow it away anyway). Any solution really has to be
about a config / parameter change (but if an index would work, I suppose I’d
be willing to try it as a work around for the time being).
Thanks in advance for any pointers. I’m hoping that there’s an init
parameter or something that was new in the 12.2 engine from 12.1 that might
be causing the problem.
Steve
HTML Editor - Full Version
Disclaimer
The information contained in this communication from the sender is
confidential. It is intended solely for use by the recipient and others
authorized to receive it. If you are not the recipient, you are hereby
notified that any disclosure, copying, distribution or taking action in
relation of the contents of this information is strictly prohibited and may
be unlawful.
This email has been scanned for viruses and malware , and may have been
automatically archived.