मेरे पास निम्न चयन कथन है जो लगभग तुरंत समाप्त होता है। अद्यतन बयान लेखन की संख्या कम करने के अंत में शून्य करने के लिएअद्यतन एक से अधिक समय क्यों लेता है?
and InvoicesCharges.orderaccnumber <> Accountnumbersorders.accountnumber
, यह:
declare @weekending varchar(6)
set @weekending = 100103
select InvoicesCharges.orderaccnumber, Accountnumbersorders.accountnumber
from Accountnumbersorders, storeinformation, routeselecttable,InvoicesCharges, invoice
where InvoicesCharges.pubid = Accountnumbersorders.publication
and Accountnumbersorders.actype = 0
and Accountnumbersorders.valuezone = 'none'
and storeinformation.storeroutename = routeselecttable.istoreroutenumber
and storeinformation.storenumber = invoice.store_number
and InvoicesCharges.invoice_number = invoice.invoice_number
and convert(varchar(6),Invoice.bill_to,12) = @weekending
हालांकि, बराबर अद्यतन बयान 1m40s
declare @weekending varchar(6)
set @weekending = 100103
update InvoicesCharges
set InvoicesCharges.orderaccnumber = Accountnumbersorders.accountnumber
from Accountnumbersorders, storeinformation, routeselecttable,InvoicesCharges, invoice
where InvoicesCharges.pubid = Accountnumbersorders.publication
and Accountnumbersorders.actype = 0
and dbo.Accountnumbersorders.valuezone = 'none'
and storeinformation.storeroutename = routeselecttable.istoreroutenumber
and storeinformation.storenumber = invoice.store_number
and InvoicesCharges.invoice_number = invoice.invoice_number
and convert(varchar(6),Invoice.bill_to,12) = @weekending
लेता है यहां तक कि अगर मैं जोड़ने एक ही समय लेता है।
क्या मैं यहां कुछ गलत कर रहा हूं? इतना बड़ा अंतर क्यों है?
अतिरिक्त और खंड अभी भी एक अच्छा विचार है, 50,000 पंक्तियों को अपडेट क्यों करें जब आपको केवल 2 अपडेट करने की आवश्यकता हो? – HLGEM