The following clause can be used at the end of a SQL query to define the node context and the goal of the query.
This clause defines what node the query should be evaluated from. This is alternative to using the open_query() function.
The clause must be used following all standard SQL clauses and takes the form USE NODE 'node'.
The node specified must be a known area or edge node and the node name must be enclosed in single quotes.
USE NODE 'Florida'
Either USE NODE or open_query() must be used to set a node context for a query.
This clause defines the query goal where multiple servers are available under an edge node. This is alternative to using the set_goal() function.
The clause must be used following all standard SQL clauses and takes the form USE GOAL <goal>.
The goal specified must be one of the following:
- Response - gives the fastest possible query response time
- Available - provides the highest availability
- Balance - balances query workload across instance servers
- Recent - picks the instance node under each edge with the most recent data
- Complete - picks the instance node under each edge with the most complete data
The USE GOAL may appear before or after a USE NODE clause.
USE GOAL recent
The use of USE GOAL or set_goal() is entirely optional. If not used, then a 'response' goal is assumed.