MySQL Internals Manual  /  ...  /  Table Trigger Cache

15.6.3 Table Trigger Cache

For table triggers, all the triggers that relate to a given table are grouped in the C++ class Table_triggers_list, which in particular contains the member sp_head *bodies[TRG_EVENT_MAX][TRG_ACTION_MAX].

Note that at most one trigger per event (BEFORE, AFTER) and per action (INSERT, UPDATE, DELETE) can be defined currently.

The Table_triggers_list itself is a part of the structure struct st_table, which is better known as a TABLE handle.

As a result, each table trigger body is duplicated in each table handle, which is necessary to properly evaluate them. TABLE handles are globally cached and reused across threads, so the table triggers are effectively reused across different clients connections manipulating the same physical table.

Download this Manual
EPUB - 0.8Mb
User Comments
Sign Up Login You must be logged in to post a comment.