CREATE INDEX Customer_index(CustomerStatusId) INCLUDE(CustomerName,CustomerAddress,CustomerOrderNo);
SELECT
c.CustomerName
,c.CustomerAddress
,c.CustomerOrderNo
FROM
dbo.Customer AS c
CROSS APPLY dbo.utf_CustomerDetailInfoStatus('ACTIVE') AS cdi
WHERE
c.CustomerStatusId = cdi.CustomerStatusId OPTION(FAST 10);
SELECT
c.CustomerName
,c.CustomerAddress
,c.CustomerOrderNo
FROM
dbo.Customer AS c WHERE EXISTS(
SELECT 1 FROM dbo.utf_CustomerDetailInfoStatus('ACTIVE') AS cdi
WHERE
c.CustomerStatusId = cdi.CustomerStatusId
);