ORM and when query plans go bad

time to read 2 min | 270 words

D. Mark Lindell has a few questions about sclaing ORM:

  1. How can dynamic SQL ORMs deal with the fact that your database server (a.k.a SQL Server) can decide at any point that it is going to use an alternate query plan. A simple index HINT on the join syntax can fix this problem but how is my ORM going to handle this?
  2. How come there is no talk about scaling these ORMs. No, I'm not talking about scaling the database. A layer between the ORM and the database execution.

The answer to the first question is easy, you use index HINT when you need it. NHibernate makes it very easy to plug in your SQL (and I have several posts about - here is one) when the default approach is not sufficent, the 1.2 release goes beyond just leting you specify you SQL for queries, it lets you specify custom SQL for just about anything (Entity - CRUD, Collection - CRUD, etc).

I am not sure that I understand the second question at all, though.