SQL Challenge, getting historical dataPerformance characteristics
time to read 1 min | 127 words
After posting my solution to the problem I got some feedback about the possible performance of the query.
I just run the query over a table with 120,000~ rows, and it completed in less than second and change.
After playing with it a bit, I decided to skip the function and put the results in a table and map that, it is easier to handle it that way with NHibernate, and I can put an index on it that would save a table scan on the months result.
The major cost is a clustered index scan (95%) and nested loops join (5%). Fun stuff :-)
I am getting deep into NHibernate's queries recently, extremely powerful, especially if you combine it with your own customer dialect.
I just run the query over a table with 120,000~ rows, and it completed in less than second and change.
After playing with it a bit, I decided to skip the function and put the results in a table and map that, it is easier to handle it that way with NHibernate, and I can put an index on it that would save a table scan on the months result.
The major cost is a clustered index scan (95%) and nested loops join (5%). Fun stuff :-)
I am getting deep into NHibernate's queries recently, extremely powerful, especially if you combine it with your own customer dialect.
More posts in "SQL Challenge, getting historical data" series:
- (12 Aug 2007) Performance characteristics
- (10 Aug 2007) solution
Comments
Comment preview