Rishabh Ohri
Rishabh Ohri

Reputation: 1310

NHibernate Query Execution Plan?

HI all,

How does NHibernate executes the queries? Does it manipulates the queries and uses some query optimization techniques? And what is the query execution plan followed by NHibernate?

Upvotes: 1

Views: 826

Answers (2)

Jesse MacVicar
Jesse MacVicar

Reputation: 546

You can use a tool, such as NHibernate Profiler or SQL Server Profiler, to view the queries being executed. You may also want to research NHibernate's caching capabilities.

Upvotes: 0

Dmytrii Nagirniak
Dmytrii Nagirniak

Reputation: 24108

How does NHibernate executes the queries?

Not exactly sure about the question. But NH executes queries using normal ADO.NET with all the data passed as parameters.

Does it manipulates the queries and uses some query optimization techniques?

It generates as optimal queries as possible with the information provided for it.
It caches not only the queries, but also the data returned by them if configured so.

And what is the query execution plan followed by NHibernate?

NH takes into account that the execution plan should not be generated on the server if not required. So the execution plan will be the same for all queries of of the same kind.

Upvotes: 2

Related Questions