Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Performance Opinion Expand / Collapse
Author
Message
Posted Wednesday, December 11, 2013 11:28 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:27 AM
Points: 1,893, Visits: 2,329
Hi all,

I have created a SP in which frequentylr transaction will occur..
Can you please look at it and tell me if its fine or need some changes in performance point of view...

ALTER PROCEDURE [dbo].[usp_Job_Inbound_BuildingNote_Working]
@InstanceID nchar(3),
@SiteID nchar(3)
AS

BEGIN

SET NOCOUNT ON;

CREATE TABLE #TEMP
(
[InBound_BuildingNoteId] [int] NOT NULL,
[InstanceId] [nchar](3) NOT NULL,
[SiteId] [nchar](3) NOT NULL,
[LocalBuildingNoteId] [nvarchar](20) NOT NULL,
[LocalBuildingId] [nvarchar](20) NOT NULL,
[LocalEmployeeId] [nvarchar](20) NULL,
[Note] [nvarchar](500) NOT NULL,
[NoteCategoryCode] [nchar](3) NOT NULL,
[SequenceNumber] [int] NOT NULL,
[NoteAddedDate] [datetime] NOT NULL,
[NoteExpirationDate] [datetime] NULL,
[StatusFlag] [bit] NOT NULL,
[DateAdded] [datetime] NOT NULL,
[AddedBy] [nvarchar](75) NOT NULL,
DateChanged DATETIME NULL,
ChangedBy nvarchar(75) null,
[LocalDateChanged] [datetime] NOT NULL,
[LocalChangedBy] [nvarchar](75) NOT NULL,
[ProcessedFlag] [bit] NOT NULL,
[ProcessedDate] [datetime] NULL,
[ReturnCode] [nchar](6) NULL,
[EmailSentFlag] [bit] NOT NULL
)
----------------------------------------------------------------------------
BEGIN TRY
---------------CHECK FOREIGN KEY CONSTRAINT---------------------------------
Update IBC
SET IBC.ProcessedFlag = 1,
IBC.ReturnCode = '2001',
IBC.EmailSentFlag = 0,
IBC.ProcessedDate = GETDATE()
FROM InBound_BuildingNote IBC WITH(NOLOCK)
LEFT JOIN Building B WITH(NOLOCK) ON B.InstanceId = IBC.InstanceId
AND B.SiteId = IBC.SiteId
AND B.LocalBuildingId = IBC.LocalBuildingId
WHERE B.LocalBuildingId IS NULL
AND IBC.ProcessedFlag = 0
AND IBC.InstanceId = @InstanceID
AND IBC.SiteId = @SiteID

Update IBC
SET IBC.ProcessedFlag = 1,
IBC.ReturnCode = '2001',
IBC.EmailSentFlag = 0,
IBC.ProcessedDate = GETDATE()
FROM InBound_BuildingNote IBC WITH(NOLOCK)
LEFT JOIN Employee B WITH(NOLOCK) ON B.InstanceId = IBC.InstanceId
AND B.SiteId = IBC.SiteId
AND B.LocalEmployeeId = IBC.LocalEmployeeId
WHERE B.LocalEmployeeId IS NULL
AND IBC.ProcessedFlag = 0
AND IBC.InstanceId = @InstanceID
AND IBC.SiteId = @SiteID

Update IBC
SET IBC.ProcessedFlag = 1,
IBC.ReturnCode = '2001',
IBC.EmailSentFlag = 0,
IBC.ProcessedDate = GETDATE()
FROM InBound_BuildingNote IBC
LEFT JOIN NoteCategory B ON B.NoteCategoryCode = IBC.NoteCategoryCode
AND B.InstanceId = IBC.InstanceId
AND B.SiteId = IBC.SiteId
WHERE B.NoteCategoryCode IS NULL
AND IBC.ProcessedFlag = 0
AND IBC.InstanceId = @InstanceID
AND IBC.SiteId = @SiteID
------------------------------------------------------------------------------------------

INSERT INTO #TEMP
(
[InBound_BuildingNoteId] ,
[InstanceId] ,
[SiteId] ,
[LocalBuildingNoteId] ,
[LocalBuildingId] ,
[LocalEmployeeId] ,
[Note] ,
[NoteCategoryCode] ,
[SequenceNumber] ,
[NoteAddedDate] ,
[NoteExpirationDate] ,
[StatusFlag] ,
[DateAdded] ,
[AddedBy] ,
DateChanged ,
ChangedBy ,
[LocalDateChanged] ,
[LocalChangedBy] ,
[ProcessedFlag] ,
[ProcessedDate] ,
[ReturnCode] ,
[EmailSentFlag]
)
SELECT
N.[InBound_BuildingNoteId] ,
N.[InstanceId] ,
N.[SiteId] ,
N.[LocalBuildingNoteId] ,
N.[LocalBuildingId] ,
N.[LocalEmployeeId] ,
N.[Note] ,
N.[NoteCategoryCode] ,
N.[SequenceNumber] ,
N.[NoteAddedDate] ,
N.[NoteExpirationDate] ,
N.[StatusFlag] ,
N.[DateAdded] ,
N.[AddedBy] ,
N.DateChanged ,
N.ChangedBy ,
N.[LocalDateChanged] ,
N.[LocalChangedBy] ,
N.[ProcessedFlag] ,
N.[ProcessedDate] ,
N.[ReturnCode] ,
N.[EmailSentFlag]
FROM InBound_BuildingNote N WITH(NOLOCK)

WHERE N.ProcessedFlag = 0
AND N.InstanceId = @InstanceID
AND N.SiteId = @SiteID
------------------------------------------------------------------------------------------
;WITH CTE
AS
(
SELECT
N.[InBound_BuildingNoteId] ,
N.[InstanceId] ,
N.[SiteId] ,
N.[LocalBuildingNoteId] ,
B.BuildingId ,
E.EmployeeId ,
N.[Note] ,
NC.NoteCategoryId ,
N.[SequenceNumber] ,
N.[NoteAddedDate] ,
N.[NoteExpirationDate] ,
N.[StatusFlag] ,
N.[DateAdded] ,
N.[AddedBy] ,
N.DateChanged ,
N.ChangedBy ,
N.[LocalDateChanged] ,
N.[LocalChangedBy] ,
N.[ProcessedFlag] ,
N.[ProcessedDate] ,
N.[ReturnCode] ,
N.[EmailSentFlag]
FROM #TEMP N WITH(NOLOCK)
INNER JOIN Building B WITH(NOLOCK) ON B.InstanceId = N.InstanceId
AND B.SiteId = N.SiteId
AND B.LocalBuildingId = N.LocalBuildingId
INNER JOIN Employee E WITH(NOLOCK) ON E.InstanceId = N.InstanceId
AND E.SiteId = N.SiteId
AND E.LocalEmployeeId = N.LocalEmployeeId
INNER JOIN NoteCategory NC WITH(NOLOCK) ON NC.InstanceId = N.InstanceId
AND NC.SiteId = N.SiteId
AND NC.NoteCategoryCode = N.NoteCategoryCode
)

MERGE BuildingNote_Working B
USING CTE C ON B.InstanceID = C.InstanceID
AND B.SiteID = C.SiteID
AND B.LocalBuildingNoteID = C.LocalBuildingNoteID
WHEN MATCHED THEN
UPDATE
SET
B.BuildingId = C.BuildingId ,
B.EmployeeId = C.EmployeeId ,
B.[Note] = C.[Note] ,
B.NoteCategoryId = C.NoteCategoryId ,
B.[SequenceNumber] = C.[SequenceNumber] ,
B.[NoteAddedDate] = C.[NoteAddedDate] ,
B.[NoteExpirationDate] = C.[NoteExpirationDate] ,
B.[StatusFlag] = C.[StatusFlag] ,
B.[DateAdded] = C.[DateAdded] ,
B.[AddedBy] = C.[AddedBy] ,
B.DateChanged = GETDATE(),
B.ChangedBy = C.ChangedBy ,
B.[LocalDateChanged] = C.[LocalDateChanged] ,
B.[LocalChangedBy] = C.[LocalChangedBy]

WHEN NOT MATCHED THEN
INSERT
(
[InstanceId] ,
[SiteId] ,
[LocalBuildingNoteId] ,
BuildingId ,
EmployeeId ,
[Note] ,
NoteCategoryId ,
[SequenceNumber] ,
[NoteAddedDate] ,
[NoteExpirationDate] ,
[StatusFlag] ,
[DateAdded] ,
[AddedBy] ,
DateChanged ,
ChangedBy ,
[LocalDateChanged] ,
[LocalChangedBy]
)
VALUES
(
C.[InstanceId] ,
C.[SiteId] ,
C.[LocalBuildingNoteId] ,
C.BuildingId ,
C.EmployeeId ,
C.[Note] ,
C.NoteCategoryId ,
C.[SequenceNumber] ,
C.[NoteAddedDate] ,
C.[NoteExpirationDate] ,
C.[StatusFlag] ,
C.[DateAdded] ,
C.[AddedBy] ,
C.DateChanged ,
C.ChangedBy ,
C.[LocalDateChanged] ,
C.[LocalChangedBy]
);

-----------------------------------------------------------------------------------
--------------Changed Process Flag stauts to 1 -------------------------------
UPDATE B
SET ProcessedFlag = 1,
ProcessedDate = GETDATE()
FROM InBound_BuildingNote B WITH (NOLOCK)
INNER JOIN #TEMP T WITH (NOLOCK) ON B.LocalBuildingNoteId = T.LocalBuildingNoteId
AND B.InBound_BuildingNoteId = T.InBound_BuildingNoteId
AND B.InstanceId = T.InstanceId
AND B.SiteId = T.SiteId
END TRY

BEGIN CATCH
DECLARE @ErrorMessage NVARCHAR(4000);

SELECT @ErrorMessage = ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);

Exec [dbo].[usp_Insert_Error] 'StoreProcedure:[usp_Job_Inbound_BuildingnNote]',@@ERROR,@ErrorMessage,'','Stored Procedure';
END CATCH

----------------------------------
DROP TABLE #temp



END

Thanks a lot in advance...



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1522152
Posted Wednesday, December 11, 2013 11:47 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 5:02 AM
Points: 39,866, Visits: 36,207
More nolock abuse. Are the users aware and happy with the fact that their reports could return incorrect data?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1522156
Posted Wednesday, December 11, 2013 11:56 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:27 AM
Points: 1,893, Visits: 2,329
GilaMonster (12/11/2013)
More nolock abuse. Are the users aware and happy with the fact that their reports could return incorrect data?

Ok, I will remove that nolock part from code.......................

Other than that is the code fine?



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1522158
Posted Wednesday, December 11, 2013 11:59 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 5:02 AM
Points: 39,866, Visits: 36,207
I didn't look at it in detail.

Run it against a representative data volume, check the performance. If acceptable great. If not, identify which parts are slowest and ask for help with those.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1522159
Posted Thursday, December 12, 2013 5:52 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 6:38 AM
Points: 13,755, Visits: 28,147
I looked through it. I don't see anything egregious. It is doing a lot of work. But you don't have any really obvious issues. At least, none I spotted. I'd need to see the execution plans for the statements to identify if there were better indexes that might help performance.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1522261
Posted Thursday, December 12, 2013 2:04 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 3:14 PM
Points: 2,098, Visits: 3,155
1) Maybe you can combine the three separate UPDATEs into one, as shown below, avoiding repeated joins of the same tables.

2) Depending on the row counts, you might consider creating a filtered index on IBC.ProcessedFlag, including at least InstanceId and SiteId (if they are the clustering keys, of course you won't need to explicitly INCLUDE them, although it doesn't hurt anything to do so).

3) Beyond just this query, if you most often access the listed tables by InstanceId and SiteId, then if possible cluster the tables that way. That should speed up all your processing.
I don't know enough about the data distributions to know whether it should be ( InstanceId, SiteId ) or ( SiteId, InstanceId ), but you can determine that. If the third column is consistently specified in the WHERE, you could specify it in the clus key as well if you want; that is: ( key1, key2, LocalBuildingId | LocalEmployeeId | NoteCategoryCode ), although that lengthens the key so much that it must be weighed carefully.


Update IBC
SET IBC.ProcessedFlag = 1,
IBC.ReturnCode = '2001',
IBC.EmailSentFlag = 0,
IBC.ProcessedDate = GETDATE()
FROM InBound_BuildingNote IBC WITH(NOLOCK)
LEFT JOIN Building B WITH(NOLOCK) ON B.InstanceId = IBC.InstanceId
AND B.SiteId = IBC.SiteId
AND B.LocalBuildingId = IBC.LocalBuildingId
LEFT JOIN Employee E WITH(NOLOCK) ON E.InstanceId = IBC.InstanceId
AND E.SiteId = IBC.SiteId
AND E.LocalEmployeeId = IBC.LocalEmployeeId
LEFT JOIN NoteCategory NC ON NC.NoteCategoryCode = IBC.NoteCategoryCode
AND NC.InstanceId = IBC.InstanceId
AND NC.SiteId = IBC.SiteId
WHERE (B.LocalBuildingId IS NULL OR E.LocalEmployeeId IS NULL OR NC.NoteCategoryCode IS NULL)
AND IBC.ProcessedFlag = 0
AND IBC.InstanceId = @InstanceID
AND IBC.SiteId = @SiteID




SQL DBA,SQL Server MVP('07, '08, '09)

"We came in spastic, Like tameless horses /
We left in plastic, As numbered corpses / ...
Remember Charlie, Remember Baker /
They left their childhood On every acre /
And who was wrong? And who was right? /
It didn't matter in the thick of the fight." : the inimitable Mr. Billy Joel, about the Vietnam War
Post #1522475
Posted Thursday, December 12, 2013 5:06 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 3:25 AM
Points: 3,417, Visits: 5,328
You should wrap your UPDATEs/INSERT/MERGE in a TRANSACTION and then do COMMIT/ROLLBACK consistent with your error handling.


My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1522526
Posted Thursday, December 12, 2013 11:19 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:27 AM
Points: 1,893, Visits: 2,329
dwain.c (12/12/2013)
You should wrap your UPDATEs/INSERT/MERGE in a TRANSACTION and then do COMMIT/ROLLBACK consistent with your error handling.


Thanks Dwain, I will do that



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1522576
Posted Thursday, December 12, 2013 11:37 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:27 AM
Points: 1,893, Visits: 2,329
ScottPletcher (12/12/2013)
1) Maybe you can combine the three separate UPDATEs into one, as shown below, avoiding repeated joins of the same tables.

2) Depending on the row counts, you might consider creating a filtered index on IBC.ProcessedFlag, including at least InstanceId and SiteId (if they are the clustering keys, of course you won't need to explicitly INCLUDE them, although it doesn't hurt anything to do so).

3) Beyond just this query, if you most often access the listed tables by InstanceId and SiteId, then if possible cluster the tables that way. That should speed up all your processing.
I don't know enough about the data distributions to know whether it should be ( InstanceId, SiteId ) or ( SiteId, InstanceId ), but you can determine that. If the third column is consistently specified in the WHERE, you could specify it in the clus key as well if you want; that is: ( key1, key2, LocalBuildingId | LocalEmployeeId | NoteCategoryCode ), although that lengthens the key so much that it must be weighed carefully.


Update IBC
SET IBC.ProcessedFlag = 1,
IBC.ReturnCode = '2001',
IBC.EmailSentFlag = 0,
IBC.ProcessedDate = GETDATE()
FROM InBound_BuildingNote IBC WITH(NOLOCK)
LEFT JOIN Building B WITH(NOLOCK) ON B.InstanceId = IBC.InstanceId
AND B.SiteId = IBC.SiteId
AND B.LocalBuildingId = IBC.LocalBuildingId
LEFT JOIN Employee E WITH(NOLOCK) ON E.InstanceId = IBC.InstanceId
AND E.SiteId = IBC.SiteId
AND E.LocalEmployeeId = IBC.LocalEmployeeId
LEFT JOIN NoteCategory NC ON NC.NoteCategoryCode = IBC.NoteCategoryCode
AND NC.InstanceId = IBC.InstanceId
AND NC.SiteId = IBC.SiteId
WHERE (B.LocalBuildingId IS NULL OR E.LocalEmployeeId IS NULL OR NC.NoteCategoryCode IS NULL)
AND IBC.ProcessedFlag = 0
AND IBC.InstanceId = @InstanceID
AND IBC.SiteId = @SiteID




Thanks Scott for your suggestion, I will combime multiple update statements into a single update statement..

Below is my table script to review for index point of view if any changes is required:
/****** Object:  Table [dbo].[Employee]    Script Date: 12/13/2013 12:05:44 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Employee](
[EmployeeId] [int] IDENTITY(1,1) NOT NULL,
[InstanceId] [nchar](3) NOT NULL,
[SiteId] [nchar](3) NOT NULL,
[LocalEmployeeId] [nvarchar](20) NOT NULL,
[LocalEmployeeNumber] [nvarchar](20) NOT NULL,
[OfficeId] [int] NOT NULL,
[Prefix] [nvarchar](10) NULL,
[FirstName] [nvarchar](50) NULL,
[MiddleName] [nvarchar](50) NULL,
[LastName] [nvarchar](50) NULL,
[DisplayName] [nvarchar](125) NULL,
[WorkPhoneNumber] [nvarchar](25) NULL,
[CellPhoneNumber] [nvarchar](25) NULL,
[EmailAddress] [nvarchar](75) NULL,
[SupervisorId] [int] NULL,
[PersonTypeId] [int] NULL,
[DeviceID] [nvarchar](100) NULL,
[LocalUnionID] [nvarchar](20) NOT NULL,
[OT1RateMultiple] [decimal](2, 1) NOT NULL,
[OT2RateMultiple] [decimal](2, 1) NULL,
[OT3RateMultiple] [decimal](2, 1) NULL,
[OldTravelRate] [decimal](6, 4) NULL,
[CurrentTravelRate] [decimal](6, 4) NULL,
[CurrentRateStartDate] [datetime] NULL,
[TemporaryRateCode] [nchar](3) NULL,
[StatusFlag] [bit] NOT NULL,
[DateAdded] [datetime] NOT NULL,
[AddedBy] [nvarchar](75) NOT NULL,
[DateChanged] [datetime] NULL,
[ChangedBy] [nvarchar](75) NULL,
[LocalDateChanged] [datetime] NOT NULL,
[LocalChangedBy] [nvarchar](75) NOT NULL,
[SyncTimeStamp] [timestamp] NOT NULL,
CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED
(
[EmployeeId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY],
CONSTRAINT [uq1_Employee] UNIQUE NONCLUSTERED
(
[InstanceId] ASC,
[SiteId] ASC,
[LocalEmployeeId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Employee] WITH CHECK ADD CONSTRAINT [FK_EmployeeOfficeId] FOREIGN KEY([OfficeId])
REFERENCES [dbo].[Office] ([OfficeId])
GO

ALTER TABLE [dbo].[Employee] CHECK CONSTRAINT [FK_EmployeeOfficeId]
GO

ALTER TABLE [dbo].[Employee] WITH CHECK ADD CONSTRAINT [FK_EmployeeSupervisorId] FOREIGN KEY([SupervisorId])
REFERENCES [dbo].[Supervisor] ([SupervisorId])
GO

ALTER TABLE [dbo].[Employee] CHECK CONSTRAINT [FK_EmployeeSupervisorId]
GO







_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1522579
Posted Friday, December 13, 2013 12:20 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, September 18, 2014 4:13 AM
Points: 747, Visits: 1,315
if there is large data set in the #Temp table, all you find in the query execution plan is "tableScan" for #Temp table, If you need to increase the performance then you need to index the temp table as well.
Post #1522588
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse