Need help on Query Tuning [message #405485] |
Thu, 28 May 2009 00:54 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sivakumar.rj
Messages: 17 Registered: November 2008 Location: Chennai
|
Junior Member |
|
|
I have a query which is having a case statement. The query is taking long time to executed. Is it possible to replace the case statement.
SELECT CASE
WHEN COUNT(DECODE(<fn1>,'A',1))>0 THEN 1
WHEN COUNT(DECODE(<FN2>,'A',1))>0 THEN 2
WHEN COUNT(DECODE(<FN2>,'B',1))>0 THEN 3
ELSE 4
END
FROM TBL 1,TBL2, TBL3
WHERE <EQUI JOIN CONDITIONS>
pls let me know..whether this case statement can be replaced or not....??
|
|
|
Re: Need help on Query Tuning [message #405489 is a reply to message #405485] |
Thu, 28 May 2009 01:05 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68675 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
From your previous topic named "Tuning the query":
This is NOT the case part that costs this is the rest (and most likely what you didn't post like custom function calls).
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).
Regards
Michel
[Updated on: Thu, 28 May 2009 01:06] Report message to a moderator
|
|
|