Help Center/ TaurusDB/ User Guide/ Database Proxy (Read/Write Splitting)/ Changing Configurations of a Proxy Instance/ Changing the Multi-statement Processing Mode of a Proxy Instance
Updated on 2026-01-13 GMT+08:00

Changing the Multi-statement Processing Mode of a Proxy Instance

Scenarios

When you enable multi-statement execution for a proxy instance, you can set multi-statement processing mode to Strict, Loose, or Parse.

Multi-statement Processing Modes

Table 1 Multi-statement processing modes

Mode

Description

Strict (default)

If a request containing multiple statements is routed to the primary node, the subsequent read and write requests sent over the same connection are all routed to the primary node. Read/Write splitting can only be restored after you disconnect your connection and re-establish it.

Your proxy instance will not parse these statements, so this mode is suitable when short connections are used or there is no connection reuse.

Loose

If a request containing multiple statements is routed to the primary node, the subsequent requests sent over the current connection can still be routed to the primary node or read replicas.

Your proxy instance will not parse these statements, so this mode is recommended when multiple statements contain only DML SQL statements and do not contain operations like setting session variables, creating temporary tables, creating stored procedures, or executing uncommitted transactions.

Parse

A read-only request containing multiple statements is routed based on weights. A read/write request containing multiple statements is routed to the primary node, and your proxy instance parses these statements and determines whether to split subsequent read and write requests received over the current connection based on the operations in the SQL statements. For details, see Parse Mode Description.

Parsing statements affects the proxy instance performance. The degree of the impact depends on the length and complexity of statements. It is recommended that the statements be less than 100 MB.

Constraints

The changed multi-statement processing mode applies to your proxy instance immediately. You do not need to reboot the proxy instance. If a read/write splitting connection fails due to a multi-statement execution, changing the multi-statement processing mode will not restore the connection. You will need to reconnect the connection manually.

Parse Mode Description

If multi-statements contain the operations listed here, all subsequent requests are routed to the primary node. To restore read/write splitting, you need to disconnect the connection and then re-establish it.
  • Creating temporary tables
  • Creating stored procedures
  • Executing uncommitted transactions (For example, begin is executed but commit or rollback is not executed.)
  • Executing complex or special syntax (In this case, parsing these statements will fail.)

Configuring the Multi-Statement Processing Mode

  1. Log in to the TaurusDB console.
  2. Click in the upper left corner and select a region and project.
  3. On the Instances page, click the instance name to go to the Basic Information page.
  4. In the navigation pane, choose Database Proxy.
  5. Click a proxy instance name to go to the Basic Information page.
  6. In the navigation pane, choose Parameter Modifications.
  7. Set the parameter multiStatementType as required.

    You can set this parameter to Strict, Loose, or Parse.

    Figure 1 Setting multiStatementType

  8. Click Save. In the displayed dialog box, click OK.