Reports information about an abstract plan.
sp_help_qplan id [, mode ]
is the ID of the abstract plan.
is the type of report to print, one of the following:
Mode |
Information returned |
---|---|
full |
The plan ID, group ID, and hash key, and the full query and plan text. |
brief |
The same as full, but only prints about 80 characters of the query and plan, rather than the full query and plan. This is the default mode. |
list |
The hash key, ID, and first 20 characters of the query and plan. |
Prints the brief abstract plan report:
sp_help_qplan 800005881
gid hashkey id ----------- ----------- ----------- 5 2054169974 937054374 query -------------------------------------------------------------------------- select type, avg(price) from titles group by type query_plan -------------------------------------------------------------------------- ( plan ( store Worktab1 ( i_scan type_price titles ) ) ( t_scan ( ...
Prints the full abstract plan report:
sp_help_qplan 784005824, full
If you do not supply a value for the mode parameter, the default is brief.
The permission checks for sp_help_qplan differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be a user with manage abstract plans privilege. Any user can execute sp_help_qplan for their own abstract plan. |
Granular permissions disabled |
With granular permissions disabled, you must be the database owner or a user with sa_role. Any user can execute sp_help_qplan for their own abstract plan. |
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 |
|
System procedures sp_find_qplan, sp_help_qpgroup