Patent ID: 6721725
Filing Date: 2004-04-13
Classification: G06F,Y10S

Abstract:
A method of forming an execution plan for at least one trigger in an active database, comprising:determining any triggers that may be activated by an activating statement; determining any rows affected by the activating statement; forming an operator tree for the activating statement; forming a tree for the triggers that are activated by the activating statement, wherein the activated trigger is either a row-after trigger or a statement-after trigger; if the activated trigger is a row-after trigger, joining the tree for the row-after trigger to the operator tree for pipelined execution with the operator tree, wherein any rows affected by the activating statement are pipelined to the row-after trigger for input; and if the activated trigger is a statement-after trigger, joining the tree for the statement-after trigger to the operator tree for execution subsequent to the operator tree, the activated statement-after trigger obtaining input during execution from a temporary table that accumulates affected rows from the execution of the activating statement; wherein joining the tree for the activated statement-after trigger to the operator tree of the activating statement for execution subsequent to activating statement includes: interconnecting a flow operator between the temporary table and the activating statement tree; and interconnecting an ordered union operator between the flow operator and the tree for the activated statement-after trigger.