7.6.4.3 Rewriter Query Rewrite Plugin Reference (original) (raw)

7.6.4.3 Rewriter Query Rewrite Plugin Reference

The following discussion serves as a reference to these elements associated with the Rewriter query rewrite plugin:

7.6.4.3.1 Rewriter Query Rewrite Plugin Rules Table

The rewrite_rules table in thequery_rewrite database provides persistent storage for the rules that the Rewriter plugin uses to decide whether to rewrite statements.

Users communicate with the plugin by modifying the set of rules stored in this table. The plugin communicates information to users by setting the table'smessage column.

Note

The rules table is loaded into the plugin by theflush_rewrite_rules stored procedure. Unless that procedure has been called following the most recent table modification, the table contents do not necessarily correspond to the set of rules the plugin is using.

The rewrite_rules table has these columns:

7.6.4.3.2 Rewriter Query Rewrite Plugin Procedures and Functions

Rewriter plugin operation uses a stored procedure that loads the rules table into its in-memory cache, and a helper loadable function. Under normal operation, users invoke only the stored procedure. The function is intended to be invoked by the stored procedure, not directly by users.

7.6.4.3.4 Rewriter Query Rewrite Plugin Status Variables

The Rewriter query rewrite plugin supports the following status variables. These variables are available only if the plugin is installed (seeSection 7.6.4.1, “Installing or Uninstalling the Rewriter Query Rewrite Plugin”).