sp_cmp_qplans

Description

Compares two abstract plans.

Syntax

sp_cmp_qplans id1, id2

Parameters

id1, id2

are the IDs of two abstract plans.

Examples

Example 1

Compares abstract plan 411252620 to 1383780087:

sp_cmp_qplans 411252620, 1383780087
The queries are the same.
The query plans are the same.

Example 2

Compares abstract plan 2091258605 to 647777465:

sp_cmp_qplans 2091258605, 647777465
The queries are the same.
The query plans are different.

Usage

Permissions

The permission checks for sp_cmp_qplans differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be a user with manage abstract plans privilege or monitor qp performance privilege.

Any user can compare plans that they own.

Granular permissions disabled

With granular permissions disabled, you must be the database owner or a user with sa_role.

Any user can compare plans that they own.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

System procedures sp_cmp_all_qplans, sp_help_qpgroup