mquery
The mquery operator ties the fate of several queries together into one larger query, called a multiquery.
Synopsis
Operator mquery()
will take one or more AFL statements and execute them sequentially,
starting with the first, as one query.
mquery(afl_statement_1,
afl_statement_2,
...,
afl_statement_n);
The latest version of an array produced by some afl_statement_j
(where j is one of n total
AFL statements in a given mquery()
) is visible for each successive afl_statement_(j+1)
(put another way, later AFL statements in a mquery()
see the latest versions of arrays
updated by earlier AFL statements of the same mquery()
query).
Once the first AFL statement has executed successfully, the second will then execute.
mquery(afl_statement_1, -- Executes successfully (first).
afl_statement_2) -- Following afl_statement_1, executes successfully (second).
Should any one AFL statement fail, then any changes to SciDB array state will be
rolled back for executed statements and subsequent statements will not be executed.
mquery(afl_statement_1, -- Executes successfully.
afl_statement_2) -- Failure here, rollback array state changes from afl_statement_1.
Limitations
No DDL permitted in
mquery()
.Top-level AFL statements in
mquery()
may only beinsert()
ordelete()
._fetch
keyword not supported ininsert()
anddelete()
when invoked frommquery()
.No AQL-equivalent for
mquery()
counterpart will be implemented.Arrays updated by
mquery()
haveREAD COMMITTED
isolation with respect to other queries.
Example