Thank you
Mas Husain, January 27, 2016 - 6:57 pm UTC
Magic
A reader, November 28, 2016 - 1:30 am UTC
This is magic
i experienced the same issue a query will run in 2 seconds but only at the first time
and this fix really worked for me
Thanks
November 28, 2016 - 2:57 am UTC
Glad we could help
Solved my issue
Mike, February 07, 2017 - 11:45 am UTC
Frustrated beyond belief trying to find the cause of this behaviour, the hint resolved my issue.
February 07, 2017 - 4:26 pm UTC
Glad we could help, and thanks for letting us know
Works Like a Charm
Kara Danvers, July 31, 2017 - 8:57 pm UTC
Exactly what I was looking for, thanks Connor McDonald
August 01, 2017 - 2:22 am UTC
glad we could help
Oracle's bizarre behavior
Mo, March 28, 2018 - 3:38 am UTC
I tried the same hint and it really helped me. However this does not explain why it happened? Oracle's carnality feedback feature is supposed to improve performance of the query by benefiting from some real life statistics collected from the first execution. How on earth could that lead up to drastically slowing the query down and generating crappy execution plans? Oracle should really apologize to customers over this!!
A reader, September 14, 2020 - 4:44 pm UTC
I just got hit with this in 2020. How is this not considered a bug? A query that should take 20s to complete wouldn't finish on for one of my clients, but with no error. It's nice there's a workaround, but the SQL should just run.
September 16, 2020 - 1:50 am UTC
When you encounter things like this, I encourage you to dump out a full test via
dbms_sqldiag.export_sql_testcase
and log it with Support. Every input we get helps make the optimizer better
Opposite Issue
David Scott Norton, September 16, 2021 - 3:29 pm UTC
Hello, I have the opposite issue. A query runs slow the first attempt of the day, then fast the rest of the day. On the next day it's slow again the first time.
September 20, 2021 - 4:04 am UTC
Most likely causes are parsing or buffer cache staleness.
If you take a look at v$active_session_history or run a trace, ie, dbms_monitor.session_trace_enable(waits=>true) you can see where the time is lost. Then ping us back here and we can advise you accordingly.
Same issue but the hints really worked
Paartha, February 23, 2023 - 1:58 pm UTC
Same issue but the hints really worked.
The query we were running was taking 15 secs and next run more than hours.
After using the hints the query started working steadily within 15 seconds.
Thanks and Regards
February 27, 2023 - 1:39 am UTC
Glad we could help