Documentation — Commands reference

execute

Runs a statement directly on the segments of a table. It is the tool for what SynSQL does not do itself: indexes, constraints, maintenance.

Syntax

execute [force] [query] on TABLE_NAME [upon all segments | upon SERVER_NAME] STATEMENT;
  • query is optional and means nothing.
  • upon all segments (the default) runs the statement on every segment; upon SERVER_NAME on the segments of one data broker.
  • By default, if one segment is out of date or its data broker is down, the command is refused. force runs the statement on the others.
execute on orders upon all segments create index ix_customer on orders (customer_id);

The statement is the one of MariaDB: write the name of the table as it is on the data brokers.

Result

  • On all the segments, the data brokers are taken group by group (see the affinity column of the installation file) and the command ends with Query is over.. An error met on a data broker is reported when it happens.
  • On one data broker, the answer is Info: query succeded. or Info: query failed..

Warnings

  • SynSQL does no check of the statement. A statement that changes the structure of a segment can leave the cluster inconsistent. Try it on a test table first.
  • The table must be deployed and not locked.
  • You need the EXECUTE privilege.
  • It is also refused if the cluster has more data brokers than the license allows.

← dump  |  exit →