SQL Optimization in Oracle -


We are using Oracle 11 and I recently acquired Dell SQL Optimizer (included with the Export Todd package). Have done A statement was given this morning that was taking longer than normal to walk, and after we finally ran it (since it was made to remember some situations) I was curious, before any SQL Optimizer Never used, how it changes it It has come back with more than 150 variations of the same statement, but the person with the lowest cost has been added only in the following line.

  and o.curdate> 0 + UID * 0  

We already had o.curdate> 0, and "+ UID * 0" was added. It reduced the runtime from one minute to three seconds. I think that Oracle's words have to do with translation and processes, but I was curious that if any oracle guru would be able to provide some insight, then this is more than zero probability, in this sequence, 15 times Thanks!

UID * 0 is used to hide 0 from the adapter. To find out, the adapter will use its data data to determine whether o.curdate> 0 is understood until the adapter has o.curdate & gt; Value This will do it. But when the value is unknown (because the function UID will be called execution and will be mixed in any way), then the adapter will not be able to see what percentage of the rows can be used and thus an avarage best access method Choses.

Example: With ID 1 to 100 you have a table. Asking for ID will result in> 0 full table scan, while Asking for ID> 99 will probably result in an index range scan, when asking for ID> 0 + UID * 0, suddenly the optimizer becomes blind for the value, And this can select index plan, then complete table scan.


Comments