Hi everybody.
I'm hitting performance issues whilst using change tracking. In my solution I decided to firstly check if there are any changes and later synchronize only part of them, where the changes actually appeared.
The problem is I would like to filter out changes made by the same publisher. The query:
select case
when exists(select * from changetable(changes [dbo].[Table1], 1) a
)
then '1'
else '0'
end
executes immediately.
The problem appears with:
declare @t1 varbinary(128)
select @t1 = CAST('Publisher#Publication' AS varbinary(128))
select case
when exists(select * from changetable(changes [dbo].[Table1], 1) a where sys_change_context <>@t1
)
then '1'
else '0'
end
This one takes considerable long time, making problems with timeouts, etc.
Is there any way to boost performance of this query? Make change to internal indexes or something?