MaxScale/Reference/Hint-Syntax.md
2015-02-05 12:56:32 +00:00

1.3 KiB

Hint Syntax

Use either ’-- ’ (notice the whitespace) or ’#’ after the semicolon or ’/* .. */’ before the semicolon.

The MySQL manual doesn’t specify if comment blocks, i.e. ’/* .. */’, should contain a w hitespace character before or after the tags.

All hints must start with the ’maxscale tag’: -- maxscale

The hints right now have two types, ones that route to a server and others that contain name-value pairs.

Routing queries to a server: -- maxscale route to [master | slave | server ]

The name of the server is the same as in MaxScale.cnf

Creating a name-value pair: -- maxscale =

Currently the only accepted parameter is ’max_slave_replication_lag’

Hints can be either single-use hints, which makes them affect only one query, or named hints, which can be pushed on and off a stack of active hints.

Defining named hints: -- maxscale prepare

Pushing a hint onto the stack: -- maxscale begin

Popping the topmost hint off the stack: -- maxscale end

You can define and activate a hint in a single command using the following: -- maxscale begin

You can also push anonymous hints onto the stack which are only used as long as they are on the stack: -- maxscale begin