SQL Optimizer HINT works but dbms_sqldiag.create_sql_patch is slower
This describes a procedure that I hope will improve application performance without touching the application code.
The application uses IBM Rational ClearQuest to search a moderately large 9M row Table with code lookups and access restrictions. The user types either a unique ID or a low cardinality PRI but CQ always generates WHERE ID LIKE '%<unique ID>%'. The Oracle optimizer thinks that this will match on 5% of the rows so it does a Full Table Scan. If you take away the first % or use = then the query is very fast. I believe that I can use dbms_sqldiag.create_sql_patch to inject a hint into the SQL without changing the application. Query time will go from 5 minutes down to sub-second. This