All Products
Search
Document Center

ALTER OUTLINE

Last Updated: Jun 18, 2021

Description

This statement supports only the outlines that you create by using SQL_TEXT. You can execute this statement to add and bind outlines and throttling rules.

Syntax

ALTER OUTLINE outline_name ADD stmt [ TO target_stmt ]

Parameter description

Parameter

Description

outline_name

The name of the outline to be created.

stmt

The value is generally a DML statement that contains hints and original parameters.

TO target_stmt

Assume that you do not specify TO target_stmt and the SQL statement accepted by the database is parameterized. If the parameterized SQL statement is the same as the parameterized text of stmt from which the hint is removed, the SQL statement is bound to the hint in stmt to generate an execution plan. If you need to generate a fixed plan for the statement that contains a hint, you must use TO target_stmt to specify the original SQL statement.

Notice

When target_stmt is used, it is strictly required that stmt exactly matches target_stMT from which the hint is removed.

Examples

  • Execute ALTER OUTLINE 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 ALTER OUTLINE 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

  • You can specify only one execution plan for one outline_name. If you specify an execution plan by executing the create outline statement, you cannot add an execution plan by executing alter outline.

  • When you execute alter outline, you can specify only a throttling rule or an execution plan. This is similar to the rule of executing create outline.

  • When you execute alter outline, outline_name must match the signature.