Показать сообщение отдельно
Старый 10.12.2009, 18:36   #88  
mazzy is offline
mazzy
Участник
Аватар для mazzy
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
29,472 / 4494 (208) ++++++++++
Регистрация: 29.11.2001
Адрес: Москва
Записей в блоге: 10
В общем, не могу найти про 8 или 16 таблиц. Помогите ссылкой если кто помнит прямую и явную ссылку

вкратце http://msdn.microsoft.com/en-us/library/ms190623.aspx
Цитата:
The sequence in which the source tables are accessed.
Typically, there are many sequences in which the database server can access the base tables to build the result set. For example, if the SELECT statement references three tables, the database server could first access TableA, use the data from TableA to extract matching rows from TableB, and then use the data from TableB to extract data from TableC. The other sequences in which the database server could access the tables are:
TableC, TableB, TableA, or
TableB, TableA, TableC, or
TableB, TableC, TableA, or
TableC, TableA, TableB
...

The SQL Server query optimizer is a cost-based optimizer. Each possible execution plan has an associated cost in terms of the amount of computing resources used. The query optimizer must analyze the possible plans and choose the one with the lowest estimated cost. Some complex SELECT statements have thousands of possible execution plans. In these cases, the query optimizer does not analyze all possible combinations. Instead, it uses complex algorithms to find an execution plan that has a cost reasonably close to the minimum possible cost.
Вот точно помню, был документ, который описывал при каких условиях SQL считает запрос сложным (Complex SELECT statement).

Далее, насколько я понимаю, сейчас msdn показывает инфу по SQL 2008. Раньше, насколько я помню, никаких "instead" не было. Говорилилось, что запрос не оптимизируется, а тупо выполняется как написан вложенными циклами.

Найти только не могу. Попробую поискать ночером.
__________________
полезное на axForum, github, vk, coub.