Submitting forms on the support site are temporary unavailable for schedule maintenance. If you need immediate assistance please contact technical support. We apologize for the inconvenience.
Getting alternatives which contain SUBSTR(UID, 1, 0) when generating alternatives with Auto Optimize
설명
When using the SQL Rewrite | Auto Optimize option, there are always some alternative queries which contain SUBSTR(UID, 1, 0).
For example and alternative to
select * from emp where emp.ename = 'AA'
is
select * from emp where emp.ename = 'AA' || SUBSTR(UID, 1, 0)
Why is this select better? It is really a better alternative?
해결 방안
The objective is to give as many alternatives as possible for a select. By concatenating SUBSTR(UID, 1, 0) to a char we do not add any value but we can change the oracle cost. This can be helpful in some scenarios. SUBSTR(UID, 1, 0) is used, as an example, any other Oracle function could have been used . An empty string used to be concatenated, before ('AA'||''), but it doesn't work any more so the empty string was replaced by SUBSTR(UID, 1, 0) as it is runtime generated.