|
|
@ -204,12 +204,12 @@ All triggers for a relation must be specified together, in the same system op.
|
|
|
|
In other words, ``::relation set_triggers`` simply replaces all the triggers associated with a stored relation.
|
|
|
|
In other words, ``::relation set_triggers`` simply replaces all the triggers associated with a stored relation.
|
|
|
|
To remove all triggers from a stored relation, simply pass no queries for the system op.
|
|
|
|
To remove all triggers from a stored relation, simply pass no queries for the system op.
|
|
|
|
|
|
|
|
|
|
|
|
As a very simple example of using triggers to make index, let's say we have the following relation::
|
|
|
|
As a very simple example of using triggers to maintain an index, let's say we have the following relation::
|
|
|
|
|
|
|
|
|
|
|
|
:create rel {a => b}
|
|
|
|
:create rel {a => b}
|
|
|
|
|
|
|
|
|
|
|
|
However, we often want to use ``*rel[a, b]`` with ``b`` bound but ``a`` unbound. This will cause a full scan,
|
|
|
|
However, we often want to use ``*rel[a, b]`` with ``b`` bound but ``a`` unbound. This will cause a full scan,
|
|
|
|
which can be expensive. So we really need an index::
|
|
|
|
which can be expensive. So we need an index::
|
|
|
|
|
|
|
|
|
|
|
|
:create rel.rev {b, a}
|
|
|
|
:create rel.rev {b, a}
|
|
|
|
|
|
|
|
|
|
|
|