视图自我左外部联接查询性能低下在SQL中花费很长时间

时间:2018-10-09 09:40:18

标签: sql-server-2012

任何人都可以就如何提高以下查询的性能提出建议。注意,该问题似乎是由Left外部连接条件子句引起的。

    ALTER VIEW [dbo].[CustomerAccountRelatedAccounts]
AS
SELECT        
    ca.AccountNumber, ca.ShipTo, ca.SystemCode, cafg.AccountNumber AS RelatedAccountNumber, cafg.ShipTo AS RelatedShipTo, 
    cafg.SystemCode AS RelatedSystemCode
FROM dbo.CustomerAccount AS ca 
    LEFT OUTER JOIN dbo.CustomerAccount AS cafg 
        ON ca.FinancialGroup = cafg.FinancialGroup 
            AND ca.NationalAccount = cafg.NationalAccount
            AND cafg.IsActive = 1
WHERE CA.IsActive = 1
GO

这是执行计划; https://www.brentozar.com/pastetheplan/?id=HJ7_N-9cQ

0 个答案:

没有答案