472,336 Members | 1,151 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Difference between SQL Queries

nikpreek
Hi All,

I know its very basic question and event I know the answer for this. But I haven't found any proof of this. Is there any difference between thse queries (given below at end of post)? (In terms of performance)
  • I'm using SQL 2000 and 2005 both.
  • When I check with "Esimated Execution Plan", there is no difference (50% each), but there is very little data in my tables.
  • I feel, Query 1 is preferred style of T-SQL developers and Query 2 is preferred Style of PL/SQL developers.
  • Query 2 runs much faster is Oracle 9i (I had worked earlier)

Query 1:
Expand|Select|Wrap|Line Numbers
  1. Select     Cust.CustomerID, Cust.CustomerCode, Cust.FullCustName, 
  2.     Cycl.CycleID, Cycl.CycleCode,
  3.     Jobs.JobID, Jobs.JobNo, Files.FileID, Files.[FileName], 
  4.     Files.FileSize, Files.Status
  5. From     CustomerCode Cust INNER JOIN Setup Setu ON Cust.CustomerID = Setu.CustomerID 
  6.     INNER JOIN FSECycles Cycl ON Setu.SetupID = Cycl.SetupID
  7.     INNER JOIN FSEJobs Jobs ON Cycl.CycleID = Jobs.CycleID 
  8.     INNER JOIN FSEFiles Files ON Jobs.JobID = Files.JobID
  9.  
Query 2:
Expand|Select|Wrap|Line Numbers
  1. Select     Cust.CustomerID, Cust.CustomerCode, Cust.FullCustName, 
  2.     Cycl.CycleID, Cycl.CycleCode,
  3.     Jobs.JobID, Jobs.JobNo, Files.FileID, Files.[FileName], 
  4.     Files.FileSize, Files.Status
  5. From     CustomerCode Cust, Setup Setu, FSECycles Cycl,
  6.     FSEJobs Jobs, FSEFiles Files
  7. Where Cust.CustomerID = Setu.CustomerID 
  8. And Setu.SetupID = Cycl.SetupID
  9. And Cycl.CycleID = Jobs.CycleID
  10. And Jobs.JobID = Files.JobID
  11.  
Sep 3 '07 #1
3 1742
debasisdas
8,127 Expert 4TB
In the first query you are using INNER JOIN syntax explicitely. this is as per ANSI specifications . Performance wise this is faster than the second one.
Sep 3 '07 #2
Thanks mate.
Is there any more detailed description available on net?

Thanks in advance.
Sep 3 '07 #3
debasisdas
8,127 Expert 4TB
Thanks mate.
Is there any more detailed description available on net?
Yes of course .
But only you need to search for that.
Sep 5 '07 #4

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

Similar topics

34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody...
0
by: Doug Reese | last post by:
hello, i have what seems to me a very common operation i'm performing. i need to find the balance on an invoice. i was not having any problems...
1
by: Shane Niebergall | last post by:
Can someone explain why there is such a big performance difference in these two queries? Note: I have a multicolumn index on ltid and inuse. ...
5
by: mas | last post by:
I have a Stored Procedure (SP) that creates the data required for a report that I show on a web page. The SP does all the work and just returns...
28
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft...
1
by: developmental2 | last post by:
Hi all..! If I want to split an SQL DB into several physical files (as its 500GB disk ran out of space, won't even run shrinks any more, and we...
23
by: Nishant Saini | last post by:
Dear All, We have a database which contains many tables which have millions of records. When We attach the database with MS SQL Server 2005...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a...
2
by: getmeidea | last post by:
I have two tables 1. AccountMaster(AccountID int, Name varchar(20)) 2. Transactions(TransID, AccountID int, Amount float) I have two queries...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.