/
mquery

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

  1. No DDL permitted in mquery().

  2. Top-level AFL statements in mquery() may only be insert() or delete().

  3. _fetch keyword not supported in insert() and delete() when invoked from mquery().

  4. No AQL-equivalent for mquery() counterpart will be implemented.

  5. Arrays updated by mquery() have READ COMMITTED isolation with respect to other queries.

Example