This is done using Fluent NHibernate.
I have a NHibernate search that retrieves data from a single table. If I take the generated sql and run it through the query analyzer, it will take ~ 18 ms to complete.
Using NHProfiler, I get the duration of this query as ~ 1800 ms - 100 times longer than sql!
Query duration - Database only:1800ms - Total: 1806ms
The object that is populating contains a child class, but this child is loaded from NHibernate's second-level cache
The data that is returned is uploaded (50 per request), although, as far as I can tell, this should not make any difference.
I also have a counter, and again it takes ~ 4 ms in the query analyzer and ~ 1800 ms according to NHProfiler.
Is NH Profiler showing query execution time or total time to retrieve, map classes, and graph objects? And if this is the first - why does it take much longer than directly executing the request?
EDIT: I just found this Ayende post about the Request Duration value set in NH Profiler: http://ayende.com/Blog/archive/2009/06/28/nh-prof-query-duration.aspx - so this is definitely a request database that takes a lot of time
source share