Trigger reading from two view tables and write on a different table takes more than 12 seconds, what might be the issue here?

2018-06-05 08:28:31

Trigger reading from two view tables and write on a different table takes more than 12 seconds, what might be the issue here?

In my case, I am using a trigger to read from two view tables (Decisions2 and Con_Decisions_Groupby), each table contains more than 20000 records, and only I want the trigger to work with the updated values and if a new record is added to the view table, and not to go through all the records in order to hide the delay.

This is my trigger: (I am not sure if it is written correctly to cover my case)

USE [W1]

GO

/****** Object: Trigger [azteca].[trg_WOcommittee_02] Script Date: 6/5/2018 10:23:41 AM ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

ALTER TRIGGER [azteca].[trg_WOcommittee_02]

ON [azteca].[WORKORDER]

AFTER UPDATE, insert

AS

UPDATE [azteca].[REQUEST]

SET [azteca].[REQUEST].[TEXT11] = [dbo].[Decisions2].[L1_Desecion],

[azteca].[REQUEST].[TEXT12] = [dbo].[Decisions2].[L2_Desecion],

[azteca].[REQUEST].[TEXT1