NHProf new feature: Expensive queries report
It has been a while since we had a new major feature for the profiler, but here it is:
The expensive queries report will look at all your queries and surface the most expensive ones across all the sessions. This can give you a good indication on where you need to optimize things.
Naturally, this feature is available across all the profiler profiles (NHibernate Profiler, Entity Framework Profiler, Linq to SQL Profiler and Hibernate Profiler).
Comments
What is the definition of expensive query? Long execution time? CPU utilization? IO utilization? Heavy locking?
Also, the total cost of query (TCQ for CIOs) is calculated by multiplying single query cost by number of query executions / unit of time
Expensive means took the longest time.
This is calculated on a single query basis, not across all similar queries.
This tend to be a really really nice feature, but I think that query optimization is best done using a profiler in production environment and finding what is happening during real database usage and in real production machine.
Execution time tends to be different from local sql server, or dev machine respect to production one, but surely this is a nice feature to have.
NHProfiler really rocks.
Alk.
Gian,
I agree with you that only on production (or at least QA) you can find the real numbers.
But even on non prod systems, that can give you very strong indications about how things are going
Yes, you are right, in dev environment we can have indicators, just to find if some queries are really really bad, and then refinement should be made on QA or Production machine.
In my opinion the problem is in the hardware: some devs have machine with 2 gb ram and they test on local sql server, but numbers are really really different when you run the same set of queries on a 2xXeon, 12 GB ram and a bunch of SAS 15k iSCSI disks :).
alk.
Comment preview