If you want to find the worst performing queries by time taken, I'd use this:
SELECT *
FROM sys.dm_exec_query_stats a
CROSS APPLY sys.dm_exec_sql_text(sql_handle) hnd
ORDER BY total_elapsed_time/execution_count DESC
However, finding the "worst" queries often requires a bit more probing into the exec_query_stats DMV. There are lots of things to consider:
- Worst individual queries by time taken which the above query will yield.
- Worst cpu hogs (if you are running high on CPU) which would order by total_worker_time/execution_count
- Queries doing the most reads which are often queries that take the longest.
Now these queries will highlight queries that have poor performance but often you might have queries with "fair" performance but get called very frequently which drives down the overall performance of your app. To find these, order the above query by total_elapsed time (or total_[whatever metric you are interested in]) and do not divide by execution_count.