473,706 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Difference between SQL Queries

nikpreek
22 New Member
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 1817
debasisdas
8,127 Recognized Expert Expert
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
nikpreek
22 New Member
Thanks mate.
Is there any more detailed description available on net?

Thanks in advance.
Sep 3 '07 #3
debasisdas
8,127 Recognized Expert Expert
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
7100
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. Yensao
0
2456
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 v4.0.13-standard for pc-linux. there must be a better way to query for this information than the method i'm using, since the result with v4.0 is not what i expected, nor what i received with v3.23. i'm including sample data and queries with my...
1
1545
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 ltid='8' and inuse<'1098298863'; Query OK, 0 rows affected (46.35 sec) Rows matched: 0 Changed: 0 Warnings: 0 mysql> UPDATE leads SET inuse='0' WHERE inuse='1' and ltid='8' and inuse<'1098298863';
5
4153
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 DataGrid. The SP takes a product area and a start and end date as parameters. Here are the basics of the SP. 1. Create temp table to store report results, all columns are created that will be needed at this point. 2. Select products and general...
28
72519
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 2005 Test Environments. What is the purpose of a view if I can just copy the vode from a view and put it into a stored procedure? Should I be accessing views from stored procedures?
1
5644
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) then what is the difference between: Adding another File to the primary group which will reside on the new group; Adding another file in another group.
23
14033
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 joins, filters etc.) then they take very long time to execute while when We execute same queries on Enterprise Edition then they run 10 times faster than on standard edition. Our database does not use any features which are present in Enterprise
9
5759
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 call it Express for simplicity). I have, to try to simplify things, put the exact same DB on two systems, one running MSDE and one running Express. Both have 2 Ghz processors (one Intel, one AMD), both have a decent amount of RAM (Intel system...
2
1675
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 Query1: Select A.AccountID,A.Name,T.TransID,T.Amount from AccountMaster A, Transactions T where T. AccountID=A. AccountID
0
8695
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9282
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9154
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8987
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6614
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5937
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4708
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2089
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.