Strange Really Slow SQL Appears To Be Coming From DBMS_AUT0_SQLTUNE
Hi All,
Our DBA noticed that there are a bunch of very slow queries running in production and we are trying to figure out where they are coming from. What is really strange is the query has a complex and very bad hint that is making the query use a really bad execution plan.
Here is the hint and part of the query.
When I checked gv$sql I noticed a column called PROGRAM_ID which points to the object id in dba_objects. To my surprise here is what I found:
It look like this query that is running in production for hours and hours is coming from the auto tune process. All three of these tables are very large with around 10m rows each.