473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

INNER JOIN vs Sub-Query (with where clause)

Hi there,

I am implementing a reporting database which manipulating a huge amount of data. I used a lot of join. Just wondering which one performs better between the two scenarios:
1. INNER JOIN first then filter by the WHERE clause.
2. Sub-query which WHERE clause first then INNER JOIN.
Anybody have any recommendation?
Dec 13 '06 #1
4 11101
pragatiswain
96 Expert
Hi there,

I am implementing a reporting database which manipulating a huge amount of data. I used a lot of join. Just wondering which one performs better between the two scenarios:
1. INNER JOIN first then filter by the WHERE clause.
2. Sub-query which WHERE clause first then INNER JOIN.
Anybody have any recommendation?
Subquery keeps the sql more clear.
May be you have to see the plan, cost and execution time of both the queries and choose the better one.
Dec 13 '06 #2
As such, does it mean that there is not a general principle for using INNER JOIN or Sub-Query, at least there is not a clear cut line to say when is to use INNER JOIN and when is to use Sub-Query? But I do have this impression that the sub-query will surely add some slow down to the performance.
Dec 15 '06 #3
suvam
31
Can u please write down the exact query ?
Or U can do it yourself by identifying the driving table and where it is involved .
Dec 15 '06 #4
Hi there,

I am implementing a reporting database which manipulating a huge amount of data. I used a lot of join. Just wondering which one performs better between the two scenarios:
1. INNER JOIN first then filter by the WHERE clause.
2. Sub-query which WHERE clause first then INNER JOIN.
Anybody have any recommendation?
sorry u r s question is not clear
Dec 17 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Irlan agous | last post by:
Hello i have t tables reactie and form and this query $sql = "select reactie.persid,form.oproep,form.foto,form.id from reactie,form INNER JOIN reactie ON (reactie.persid = form.id) group by...
11
by: news-east.earthlink.net | last post by:
The scenario: two tables CustomerTable --------------- CustomerID OrderID CustomerName CustomerEmail
23
by: Brian | last post by:
Hello All - I am wondering if anyone has any thoughts on which is better from a performance perspective: a nested Select statement or an Inner Join. For example, I could do either of the...
1
by: Steve | last post by:
Hi, I am real new to databases and hoping someone can help. Main-table is a huge spreadsheet that I imported into Access Site-table has a bunch of addresses pulled from Main-table, quite a few...
3
by: Sagi | last post by:
i got two tables: tblCat, tblSubCat. i need to get the list of all the category names (CatName), CatOrder from tblCat when tblCat.CatID=tblSubCat.catPID and i need to know how many rows do i got...
4
exoskeleton
by: exoskeleton | last post by:
hi dear experts im here once again...i have a problem on showing the result when im using inner join...here's my code.. $sql_trans_pro_tbl="SELECT...
12
by: Chamnap | last post by:
Hello, everyone I have one question about the standard join and inner join, which one is faster and more reliable? Can you recommend me to use? Please, explain me... Thanks Chamnap
2
by: kjewell23 | last post by:
Hello. I'm trying to inner join two tables into one dataset. Is that possible. If so I do I do it. I have my code down below, so if you could help me. please!! I'm using asp.net for my coding Dim...
4
by: shapper | last post by:
Hello, I have 2 tables: Aid, Aname ... Bid, Aid, Bname ... I need to get the records in B given a Bname and a Aname. I think I should use Inner Join. I wrote the following code:
11
by: YZXIA | last post by:
Is there any difference between explicit inner join and implicit inner join Example of an explicit inner join: SELECT * FROM employee INNER JOIN department ON employee.DepartmentID =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.