shiny happy death knights

January 21, 2009

I’ve finally got my general stats queries working satisfactorily. Since the only difference in the queries is the column name for the statistic, dynamic SQL seemed to be the way to go – one query with a parameter to select the required statistic – mana, agi, spi, stam etc.

Unfortunately, dynamic SQL turned out to be… um… not very dynamic… when it comes to execution speed. I don’t know if this is a general database thing or just a Billg-SQL problem, but the fact is that the dynamic SQL query took 6 minutes to run, whereas its hard-coded version takes just over a minute. I’m assuming that the query optimizer can do a better job on the hardwired one.

So much for that idea then.

As software people will know, the traditional solution of editor inheritance a.k.a. “cut, paste, search, replace” never fails in these situations. So, 20 stored procedures later, here we are. Three sets of death knight stats for your enjoyment.

The stats pages for the other classes will get upgraded on the next armoury scan.