EXECUTE DIRECT

EXECUTE DIRECT — Launch queries directly to dedicated nodes

Synopsis

EXECUTE DIRECT ON ( nodename [, ... ] )
    query

Description

EXECUTE DIRECT is a SQL command specially created for Postgres-XL to allow launching queries directly on one of the nodes determined by a list of nodes nodelist.

EXECUTE DIRECT is currenlty limited to be used on 1 node at a time only. The usage of transaction queries (BEGIN, COMMIT...), DDL, and DML (INSERT, UPDATE, DELETE ) is forbidden to avoid data inconsistency among nodes in the cluster. EXECUTE DIRECT usage is also limited to superusers.

Either a Coordinator or Datanode can be selected by its node name.

EXECUTE DIRECT allows the usage of the following utility commands on remote nodes: CREATE TABLESPACE, DROP TABLESPACE.

Parameters

nodename

This mandatory clause specifies the node name on where to launch query. When specifying multiple nodes, node names have to be separated by a comma.

query

This mandatory clause specifies the raw query to launch on specified node list nodelist.

Examples

Select some data in a given table tenk1 on remote Datanode named dn1:

EXECUTE DIRECT ON NODE dn1 'SELECT * FROM tenk1 WHERE col_char = ''foo''';

Select local timestamp of a remote node named coord2:

EXECUTE DIRECT ON coord2 'select clock_timestamp()';

Select list of tables of a remote node named dn50:

EXECUTE DIRECT ON dn50 'select tablename from pg_tables';

Compatibility

EXECUTE DIRECT does not conform to the SQL standards, it is a Postgres-XL specific command.