All Products
Search
Document Center

ALTER OUTLINE

Last Updated: Jun 18, 2021

Description

You can execute the ALTER OUTLINE statement to modify outlines and configure throttling rules for SQL queries. This statement can be used only for outlines that are created based on SQL texts.

Syntax

ALTER OUTLINE outline_name ADD stmt [ TO target_stmt ]

Parameters

Parameter

Description

outline_name

The name of the outline that you want to modify.

stmt

The original data manipulation language (DML) statement that contains a hint and parameters.

TO target_stmt

You can leave TO target_stmt empty if the following requirements are met: The parameterized SQL statement is equivalent to the stmt value without the hint. In this case, the system generates an execution plan for the parameterized SQL statement that has the hint in stmt. To generate a fixed execution plan for a statement that contains a hint, specify the original SQL statement as TO target_stmt.

Notice

Make sure TO target_stmt you specify is the same as the stmt value without the hint.

Examples

  • Execute the ALTER OUTLINE statement to add throttling rules.

OceanBase (root@oceanbase)> alter outline ol_1 add select /*+max_concurrent(1)*/ * from t1 where c1 = 1 and c2 = ? ;
OceanBase (root@oceanbase)> alter outline ol_1 add select /*+max_concurrent(1)*/ * from t1 where c1 = ? and c2 = 1; 
  • Execute the ALTER OUTLINE statement to add an execution plan.

OceanBase (root@oceanbase)> create outline ol_2 on select /*+max_concurrent(1)*/ * from t1,t2 where t1.c1 = 1;
OceanBase (root@oceanbase)> alter outline ol_2 add select /*+use_nl(t2)*/ * from t1,t2 where t1.c1 = 1;

Notes

  • One outline_name argument is associated with only one execution plan. If an execution plan is added by executing CREATE OUTLINE, you cannot execute ALTER OUTLINE to add an execution plan again.

  • When you execute the ALTER OUTLINE statement, you can specify only a throttling rule or an execution plan for each execution. The similar rule applies to the CREATE OUTLINE statement.