I am not a DBA and am new to MS SQL...
I would like to know if an sql statement is performing poorly or not, more specifically, I would like to know whether a cross join select is performing poorly or not. Not in comparison to another select statement which may be more efficient if it is a reformulation of the original, but in comparison to itself (I understand this is a bit vague...).
For example I have the following table:
where my table has > 100K entries.
I run the following select:
select * from dbo.pcopy as p1, dbo.pcopy as p2;
It takes upwards of a day to complete. This, perhaps, is fine, but how can I ascertain this???
I have been shown the following select but cannot understand how to derive poor perforamce metrics from it:
select * from sys.dm_exec_query_Stats
The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:
SELECT * FROM dbo.pcopy AS p1, dbo.pcopy AS p2