On Tuesday, April 12, 2011 11:48:52 AM UTC-6, Fabio Maulo wrote:
>
> so and so... because the behavior depend on where that beast is sitted.
> people.Take(10).Where(p=> p.Name.StartsWith("D")).Skip(1)
> now try to translate it in SQL having the same behavior you have in RAM.
> then, moving the Skip, the Take and the Where do it again.
> and keep in mind that it is a very simple case.
>Yes, I know there are some differences, but I was only talking about pure SQL where as I would not be as worried about what you have above as much as paging is a vendor specific add on to SQL. This would be an area where I would say that you cannot predict the intent absolutely at the linq level (though you may be able to at the hql level) and thus would be unable to simplify/reduce the translation. When it comes to pure sql however, you are much better able to simplify/reduce an expression that may be checking for null that is redundant because the null check would already be handled by a join.
