Database Tuning (MOSC)

MOSC Banner

Decode/CASE performance issues?

edited Jan 28, 2009 11:48PM in Database Tuning (MOSC) 6 comments
Hello all,
This is my first question and it is pl/sql related in general. I've got very large tables being scanned in a report and the ETA of the report reaches about 4-5 hours sometimes.
I want to ask if it is connected with the often use of DECODE/CASE? If I replace such statements with some equivalent, will the report perform better.

Example:

Select case when a<>5 then sysdate end as x from table1

VERSUS

Select sysdate*(a-5)/nvl((a-5),1) as x from table1


I was told DECODE/CASE statements do full table scans and greatly slow down the entire report.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center