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.
Any user can execute sp_help_qplan to see the abstract plan of a query that he or she owns. Only the System Administrator and the Database Owner can display an abstract plan owned by another user.
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