December 28, 2012 at 3:45 am
Hi Please help me...
I want join 4 tables in the Oracle.Table 1 is having 4 different where conditions.
Which one is better (Performance wise)
1.Join all 4 tables and write table1 where conditions globally (After Joining 4 tables)
2.Make Table1 as Derived Table with all where conditions and joining with 3 tables.
Please help me
December 28, 2012 at 3:50 am
Test them and see?
Alternately, maybe ask on an Oracle forum where you're more likely to get an answer.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 28, 2012 at 12:02 pm
January 21, 2013 at 5:12 pm
Generally speaking (as this is a general question), probably Option 1 as it lets Oracle pick the best way of applying predicates. Under limited circumstances, option 2 will limit the way in which it applies predicates.
Ask a general question get a general answer.
January 22, 2013 at 6:35 pm
Raghu.K (12/28/2012)
I want join 4 tables in the Oracle.Table 1 is having 4 different where conditions.Which one is better (Performance wise)
1.Join all 4 tables and write table1 where conditions globally (After Joining 4 tables)
2.Make Table1 as Derived Table with all where conditions and joining with 3 tables.
Not much to work with.
Assuming you have the right indexes on place, test both cases. Since this is an Oracle question I would suggest to trace/tkprof both solutions then look at buffer_gets on both of them, usually the solution with the less buffer_gets would be the one that would perform the better.
Hope this helps.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply