MySQL Forums
Forum List  »  Triggers

Re: Using variable in trigger - high CPU usage problem
Posted by: Robert Bielik
Date: June 29, 2012 02:12AM

I finally opted for setting an event executed each day which updates a MEMORY table so I can in the trigger do:

DECLARE value INT;
SELECT `id` INTO value FROM mem_table WHERE `name`='Something';
IF (new.id=value) THEN
   INSERT INTO `accu_table` (id, ...columns...) VALUES(N, ...columns...);
END IF;

This does not influence CPU measurably.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Using variable in trigger - high CPU usage problem
1855
June 29, 2012 02:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.