Databases Reference
In-Depth Information
set showplan_all off
go
Some of the output columns from this query are shown in Figure 5-7.
FIGURE 5-7
You can also use SHOWPLAN _ XML to get the plan in an XML format:
Use AdventureWorks2012
go
set showplan_xml on
go
select * from person.person
go
set showplan_xml off
go
The results from the preceding query are
shown in Figure 5-8.
Clicking on the XML will display the
graphical execution plan shown in
Figure 5-9.
Another option is STATISTICS PROFILE .
This is the i rst option to be discussed that
executes the query, and returns a real plan.
The previous options don't execute the
query, they just return an estimated plan.
Enabling this option adds statistical information to
the showplan. This consists of the actual row count
and the number of times each operator was run
when the query was executed:
FIGURE 5-8
FIGURE 5-9
Use AdventureWorks2012
go
set statistics profile on
go
select * from person.person
go
set statistics profile off
go
Search WWH ::




Custom Search