I would guess that the performance you see on your machine is the same as on Azure, but you're likely hitting your cpu limits. I'm not sure ordering would have any issue on hydration, unless perhaps you have a poor hash code algorithm and perhaps were hitting worst case scenarios on hash tables, but that also seems pretty suspect. Do you have any .net profiling data comparing the two scenarios you outlined?
On Wednesday, October 8, 2014 7:14:11 AM UTC-6, Lauri Kotilainen wrote: > > Hi, > > I encountered a really weird situation today. I've got a NHLinq query that > does an OrderBy, then adds a bunch of Fetches and finally ToLists the whole > thing. The query returns about 700 root entities from a total of about 2000 > rows. It's a fairly heavy query, and on my development machine, it takes > between 1 and 3 seconds to finish hydrating the entities. > > The weird part starts, unfortunately, with a production database. The DB > is running on Azure SQL Databases. And on the production db, the query > takes anywhere between 15 and 20 seconds to execute. However, if I export > the production database to a copy and run the query against the copy, we're > back to between 1 and 3 seconds. > > OK, I think to myself, maybe the import/export does something to rearrange > the data. Except... according to NHProf, the query itself takes under 200ms > to execute, and the rest of the time is spent in hydration. I've confirmed > this with SQL Server Management Studio -- the SQL query itself completes in > under a second. > > And here's where it gets *really* weird: if I remove the OrderBy clause > from the NHLinq query, we're back to 1-3 second execution times. > > I guess my question is basically: what can the OrderBy call possibly do > that would make hydration an order of magnitude slower in some cases? > > -Lauri > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/d/optout.
