Here the following is a simple SQL statement with a CASE expression syntax.
SELECT *
FROM employee
WHERE
Here the following are the query plans of this SQL, it takes 4.64 seconds to finish. The query shows a Full Table Scan of the EMPLOYEE table due to the CASE expression cannot utilize the emp_salary index. It is...
How to Tune SQL Statement with CASE Expression by Hints Injection for Oracle?
SELECT *
FROM employee
WHERE
CASE
WHEN emp_salary< 1000
THEN 'low'
WHEN emp_salary>100000
THEN 'high'
ELSE 'Normal'
END = 'low'
WHEN emp_salary< 1000
THEN 'low'
WHEN emp_salary>100000
THEN 'high'
ELSE 'Normal'
END = 'low'
Here the following are the query plans of this SQL, it takes 4.64 seconds to finish. The query shows a Full Table Scan of the EMPLOYEE table due to the CASE expression cannot utilize the emp_salary index. It is...
How to Tune SQL Statement with CASE Expression by Hints Injection for Oracle?