Thursday, August 13, 2009

Whale Captured Near Karachi

Fetch Vs QueryExpression

I always asked this question. Which one is faster?, well roughly queryExpresion always thought that is faster. Consider this analysis I have always done. All I did was open the SQL Trace and see what makes the two also opened the Monkeys performance and got some facts:

This is the query I wanted to make both to the Fetch QueryExpression .

And the results are: Fetch

To monitor performance in

And the trace of SQL, we can see that did transact the query in SQL, the only thing that catches my attention here is that it has a duration of 174 milliseconds.

For QueryExpression:

Monitor performance

And the trace of SQL, we can see that performing the same query in SQL transact in the Fetch, and the duration is 0milisegundos and well , it must be wrong, it should take some time and let '5 milliseconds: D

I have not done much, I just did some trace and nothing else. I still and will continue doing my dear QueryExpression because now I can say with evidence that it takes much less.

Eye, there's a function called FetchXmlToQueryExpression, I have used this function but it takes a lot, and when I use the discarded. Sometimes you have to choose between security or optimization. What you choose? Greetings

Atilio

0 comments:

Post a Comment