|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Questionsmy question is:
"Is there different speed of process? or Which Statement owning quickest performance speed in Process?" DELETE FROM TB1 WHERE NOID LIKE 'A%' and FAge<=10 or DELETE FROM TB1 WHERE FAge<=10 and NOID LIKE 'A%' You need to know that the field NOID have the index, While Fage [do] not have index. Do both statements above have same performance speed ? Query Optimizer in SQL Server is quite smart thing, so the order of
conditions in the Where clause is not important. Both queries should produce the same execution plan. You can check this in Query Analyzer. Show quote "Bpk. Adi Wira Kusuma" <adi_wira_kus***@yahoo.com.sg> wrote in message news:%2380FzsAoFHA.1088@TK2MSFTNGP14.phx.gbl... > my question is: > "Is there different speed of process? or Which Statement owning quickest > performance speed in Process?" > > DELETE FROM TB1 WHERE NOID LIKE 'A%' and FAge<=10 > or > > DELETE FROM TB1 WHERE FAge<=10 and NOID LIKE 'A%' > > You need to know that the field NOID have the index, While Fage [do] not > have index. > > Do both statements above have same performance speed ? > > Hi
Both will produce the same query plan as the optimizer will look at it and evaluate it as being the same. Regards-- -------------------------------- Mike Epprecht, Microsoft SQL Server MVP Zurich, Switzerland IM: m***@epprecht.net MVP Program: http://www.microsoft.com/mvp Blog: http://www.msmvps.com/epprecht/ Show quote "Bpk. Adi Wira Kusuma" <adi_wira_kus***@yahoo.com.sg> wrote in message news:%2380FzsAoFHA.1088@TK2MSFTNGP14.phx.gbl... > my question is: > "Is there different speed of process? or Which Statement owning quickest > performance speed in Process?" > > DELETE FROM TB1 WHERE NOID LIKE 'A%' and FAge<=10 > or > > DELETE FROM TB1 WHERE FAge<=10 and NOID LIKE 'A%' > > You need to know that the field NOID have the index, While Fage [do] not > have index. > > Do both statements above have same performance speed ? > > |
|||||||||||||||||||||||