SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Performance of a Query : which one is giving good performace


Performance of a Query : which one is giving good performace

Author
Message
Raghu.K
Raghu.K
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 43
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)SSC Guru (88K reputation)

Group: General Forum Members
Points: 88234 Visits: 45277
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

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Jo Pattyn
Jo Pattyn
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2778 Visits: 9901
Can't tell much without actually seeing it. I had success using orafaq, just be sure you read the forum guide. Do you have a testcase (create table, insert data, select query,query plan)?
nick.mcdermaid
nick.mcdermaid
Old Hand
Old Hand (396 reputation)Old Hand (396 reputation)Old Hand (396 reputation)Old Hand (396 reputation)Old Hand (396 reputation)Old Hand (396 reputation)Old Hand (396 reputation)Old Hand (396 reputation)

Group: General Forum Members
Points: 396 Visits: 778
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.
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
SSCertifiable
SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)SSCertifiable (5.4K reputation)

Group: General Forum Members
Points: 5435 Visits: 4639
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search