Note
This variable was introduced in V4.3.1.
Description
The query_rewrite_integrity variable specifies the data consistency check level for materialized view-based query rewriting.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or viewSYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(in Oracle mode) orinformation_schema.GLOBAL_VARIABLES(in MySQL mode) to view the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or viewSYS.TENANT_VIRTUAL_SESSION_VARIABLE(in Oracle mode) orinformation_schema.SESSION_VARIABLES(in MySQL mode) to view the value of a session system variable.
Modify variables
Set the variable at the global level
The
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.For V4.x, Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable starting from V4.2.0.
Set the variable at the session level
The
systenant and all user tenants can directly modify the value of a session system variable in their own tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | enum |
| Default value | enforced |
| Value range | [enforced, stale_tolerated]
|
| Effective scope |
|
| Modifiable | Yes. The value can be modified by using the SET statement. |
Considerations
This variable is meaningful only when the value of the query_rewrite_enabled variable is not false.
Examples
The following examples show how to set the value of this variable to enforced for session-level and global-level effects, respectively.
Set the variable at the session level
obclient> SET query_rewrite_integrity= enforced;Set the variable at the global level
obclient> SET GLOBAL query_rewrite_integrity= enforced;