Flink SQL allows you to add hints to manually optimize execution plans. This topic describes how to use SQL hints.
Hints for dynamic table options
Dynamic table options are supported in Realtime Compute for Apache Flink that uses Ververica Runtime (VVR) 4.x or later. You can dynamically specify or override the table options within each query. For information about the syntax and usage examples of dynamic table options, see Dynamic Table Options.
Query hints
Lookup join hints
For information about how to use lookup join hints, see JOIN hints for dimension tables.
State TTL hints
State time-to-live (TTL) configurations reduce the state sizes of operators and enhance system stability and reliability. You can use the following methods to configure state TTL:
State TTL hints: Specify different state TTL values for specific stateful operators. This method applies only to regular join and group aggregation operators.
Methods to configure state TTL for the regular join operator
VVR 8.0.7 and later: supports state TTL hints and hints for regular join.
VVR 8.0.1 to 8.0.6: supports only hints for regular join.
Methods to configure state TTL for the group aggregation operator
VVR 8.0.7 and later: supports state TTL hints.
VVR 8.0.6 and earlier: not supported.
Deployment parameter: Specify a state TTL value for an entire deployment. For more information, see table.exec.state.ttl.
Expert mode: Specify different state TTL values for different stateful operators. For more information, see Configure operator parallelism, chaining policy, and state TTL.
The preceding methods take effect in the following order of priority: Expert mode > State TTL hints > Deployment parameter.
References
For information about the basic features of SQL hints, see SQL Hints.