Hello, HeBpuMHeCkaTuHa, you wrote: HBM>>> to optimize sql it is necessary when there are problems with performance. 90 % of operations of application it CRUD, and with it any ORM perfectly consult. G>> nonsense. It is necessary to write the optimum code at once. Premature pessimization leads to projects, which and for half a year not . HBM> premature optimization not smaller harm. The code should be normal, but there is no sense to pursue for +1 % of performance. It is incorrect. When Dijkstra wrote about premature optimization it meant small khaki at level of separate commands of the processor which give an insignificant gain of high-speed performance, but considerably worsen readership. Partially same concerns a choice , it is better than type at first the linear search, than to catch bugs in binary search with interpolation. But when we speak about high-level optimization - at level of data structures, component interactions, databases, it is necessary to optimize from the very beginning, differently then the correction price grows exponentially. Optimization SQL concerns just such type of optimization. I have a fine example. In 2008 when only appeared linq, I did a site and one person from my command was engaged in navigation creation. It was necessary to make nontrivial request which makes sampling. He/she is the person following the approach "then we optimize" wrote instead of advanced query pair foreach cycles. That Mahlo that received select n+1 so also the representation code was guided by objects of model, each of which demanded a raising on some KB of the text. As a result navigation was under construction half-seconds. I to it told that it is necessary to rewrite this business in request and to make a projection, but he told that it is a hogwash and is better we apply a cache. Also fastened a cache for objects of model. Then we on a site the real data of the client also it turned out on creation of navigation of 8 seconds. Even it became inconvenient to debug, even did not help, for the developer started from zero application almost every minute. As a result it was necessary to alter requests, to make DTO, to alter the representation code, to alter the mechanism . As a matter of fact to rewrite EVERYTHING that this programmer did. Here such price of nonoptimal requests. There is a situation of nonoptimal structure of a DB then it is necessary not to rewrite simply requests is even worse, but also given to pour and God forbid application works for the customer.