For fun I been playing with the built-in Optimizer for Oracle in Toad today. One of the optimizations it suggests is the following
AND emp.pay_type = NVL('FT', UID)
Instead of
AND emp.pay_type = 'FT'
I'm confused on what is happening here and because of it, confused on also on why this would improve performance. Since FT is a string literal within the SQL query and therefore never NULL, why would this make any difference? I'm guessing it has something to do with the existing Index on the field, but am unable to find anything in the Oracle docs.