Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://optimizermagic.blogspot.com/2007/12/why-are-there-more-cursors-in-11g-for.html" rel="nofollow">Adaptive cursor sharing does not apply to LIKE predicates.</a></p> <p>If your procedure was first executed with a parameter such as <code>%</code>, Oracle cannot use certain index access methods for the predicate. Oracle could not obey your hint, and built a plan that was pretty good for <code>%</code> but horrible for everything else.</p> <p>One possible solution is to force Oracle to always hard-parse your query. I've used this solution, as explained by Dion Cho in <a href="https://forums.oracle.com/forums/thread.jspa?threadID=854605" rel="nofollow">this OTN thread</a>:</p> <pre><code>dbms_stats.set_table_stats('schema','DOC',num_rows=&gt;null,no_invalidate=&gt;false); </code></pre> <p>Hard-parsing will use extra CPU resources, but hopefully a better plan will more than make up for the difference. This solution will cause other, unrelated queries, to require a hard-parse. You may want to look at some other solutions mentioned in the referenced thread.</p> <p>Also, your <a href="http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements006.htm#BABHJBAJ" rel="nofollow">INDEX_COMBINE</a> hint may not be correct. There should not be a comma between the indexes. However, the hint syntax is poorly documented, and the hint parser will often work "partially". Your hint is probably evaluated as the equivalant of <code>/*+INDEX_COMBINE(attr)*/</code>, which may or may not work the way you want it to. You'll never know without the plans.</p> <p>There are good reasons to avoid hints, especially if you don't have convenient access to the explain plans.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload