create plan

Creates an abstract plan.

Syntax

create plan query plan 
	[into group_name]
	[and set @new_id]

Parameters

Examples

Usage

  • create plan saves the abstract plan in the group specified with into. If no group name is specified, the plan is saved in the currently active plan group.

  • Queries and abstract plans specified with create plan are not checked for valid SQL syntax, and plans are not checked for valid abstract plan syntax. Also, the plan is not checked for compatibility with the SQL text. You should immediately check all plans created with create plan for correctness by running the query specified in the create plan statement.

  • If another query plan in the group has the same SQL text, replace mode must be enabled with set plan replace on. Otherwise, the create plan command fails.

  • You must declare @new_id before using it in the and set clause.

  • The abstract plan group you specify with into must already exist.

  • The SAP ASE server ignores any literal parameterization you specify when creating an abstract plan if you enable server-wide literal parameterization using the sp_configure "enable literal autoparam", 1 system procedure.

See also:
  • Performance and Tuning Guide: Optimizer and Abstract Plans.

  • sp_add_qpgroup, sp_configure “enable literal autoparam”, sp_find_qplan, sp_help_qplan, sp_set_qplan in Reference Manual: Procedures

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

No permission is required to use create plan.

Related reference
set