473,325 Members | 2,870 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,325 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 1806
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 help me with this? Thank you in advance. ...
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 until the production server was upgraded to mysql...
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. mysql> UPDATE leads SET inuse='0' WHERE inuse!='0' and...
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 back a results set that I dump in an ASP.NET...
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 C#.NET and Microsoft SQL Server 2000 Production and...
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 bought another 500GB disk to add to the PC)...
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 Standard Edition Server and run some queries (having...
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 difference between MSDE and SQL Express 2005 (I'll just...
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 for achieving the same result set. They are ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.