Using Procedures and Rules [ ALLBASE/SQL Performance Guidelines ] MPE/iX 5.0 Documentation
ALLBASE/SQL Performance Guidelines
Using Procedures and Rules
Stored procedures, used independently or invoked by rules, can improve
performance in the DBEnvironment. For applications that access a local
DBEnvironment, combining multiple SQL statements and logic in a stored
procedure can improve performance by reducing the overhead of multiple
calls to SQLCore.
For applications that operate on a remote DBEnvironment or in a
client/server environment, each call to SQLCore must travel across the
network. In this environment, the use of stored procedures can
dramatically reduce network traffic and thus improve performance.
It is generally better to place conditions in the FiringCondition of a
rule rather than including them as conditional statements within the
procedure invoked by the rule, to minimize the overhead of procedure
execution. The specification of a FiringCondition minimizes overhead by
avoiding unnecessary procedure calls. For each row affected by the
statement, the FiringCondition is tested, and the procedure is invoked
only when the FiringCondition is satisfied. Thus, the specification of a
FiringCondition can improve the performance of data manipulation
operations on the table on which the rule is defined.
Since a procedure executed by a rule may itself execute statements that
fire rules, the developer should carefully analyze the relationships
among rules and the procedures invoked by rules to ensure that the
performance implications on data manipulation statements that fire a
chain of rules are well understood.
MPE/iX 5.0 Documentation