the problem is on the join on logic table inserted and deleted. (they are actually log) which is extremely expensive.
I got some help from my colleague and resolve the problem, here is the solution --
since the trigger is for "after update" (default in ase), instead of joining on inserted and deleted to compare the column value change, I changed to use joining deleted with the main table tblA (force using clustered index).
!= will not cause full table scan in this case is becaused the sybase optimizer already choose the clustered index on id and the columns to comare are not index columns.
Thanks.
I got some help from my colleague and resolve the problem, here is the solution --
since the trigger is for "after update" (default in ase), instead of joining on inserted and deleted to compare the column value change, I changed to use joining deleted with the main table tblA (force using clustered index).
!= will not cause full table scan in this case is becaused the sybase optimizer already choose the clustered index on id and the columns to comare are not index columns.
Thanks.