Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 14th, 2006, 11:53 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default Query Excution Process- pros and cons



Q1>Should I apply filter in sequence(based on primarykey,not null,comparision,between clause) ?

   -How to apply filter in correct format,and SQL server internally execute it.
Q2>Should I use 'is not Null' to be put at the last or first?

Q3>Should I use 'between clause' rather than relation operator i.e(empid>10 and empid<200)

Q4>Does filters of sequence has any impact on the query execution process


   table1[pkey1,col1,col2,col3] -->pkey is pkey1
   table2[pkey2,pkey1,col11,col12,col13]--->pkey is pkey2, and pkey1 is foreign key

CaseI->select table2.pkey2,table1.col1 ,table2.col12
       from table1 inner join table2
       on table1.pkey1=table2.pkey1
      where (table1.col3>100 and table1.col3<300 ) and table2.pkey1=2020 and table2.col13 is not null

CaseII->select table2.pkey2,table1.col1 ,table2.col12
       from table1 inner join table2
       on table1.pkey1=table2.pkey1
  where (table1.col3 between 101 and 299 ) and pkey1=2020 and table2.col13 is not null





Cheers :)

vinod
__________________
Cheers :)

vinod
 
Old July 23rd, 2006, 01:02 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

Vinod,
The best way to tell is to execute both queries in Query Analyzer with Show Execution plan turned on.

David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
process.startinfo opens new instance of process Anypond General .NET 0 August 28th, 2008 05:35 AM
Pros and Cons of upgrading Access 97 DMickel Access 5 February 18th, 2006 06:00 PM
Process List ? huyremy Pro VB 6 6 October 25th, 2004 01:30 PM
Cannot stop the process mcinar SQL Server 2000 11 October 20th, 2004 07:39 AM
Pros & Cons of using Blobs in sql server sandeepk.sharma SQL Server 2000 5 May 7th, 2004 02:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.