|
LINQ - проще
|
|||
---|---|---|---|
#18+
LessypМожет вы господа сначала документацию почитаете, прежде чем вываливать на форум всякую бредятину? А то у одного оптимизатор хватает первый план который успел построить за заданное время, у второго проблемы с outer join'ом... если по сути сказать не способен, вовсе не обязательно тут строить из себя дАртаньяна и позориться. ... |
|||
:
Нравится:
Не нравится:
|
|||
17.12.2018, 14:04 |
|
LINQ - проще
|
|||
---|---|---|---|
#18+
А я пока дам свою: What Is Optimizer Timeout?SQL Server uses a cost-based query optimizer. Therefore, it selects a query plan with the lowest cost after it has built and examined multiple query plans. One of the objectives of the SQL Server query optimizer (QO) is to spend a "reasonable time" in query optimization as compared to query execution. Therefore, QO has a built-in threshold of tasks to consider before it stops the optimization process. If this threshold is reached before QO has considered most, if not all, possible plans then it has reached the Optimizer TimeOut limit. An event is reported in the query plan as Time Out under "Reason For Early Termination of Statement Optimization." It's important to understand that this threshold isn't based on clock time but on number of possibilities considered. In current SQL QO versions, over a half million possibilities are considered before a time out is reached. Optimizer timeout is designed in Microsoft SQL Server and in many cases encountering it is not a factor affecting query performance. However, in some cases the SQL query plan choice may be affected by optimizer timeout and thus performance could be impacted. When you encounter such issues, if you understand optimizer timeout mechanism and how complex queries can be affected in SQL Server, it can help you to better troubleshoot and improve your performance issue. Understanding Optimizer Timeout and how Complex queries can be Affected in SQL Server ... |
|||
:
Нравится:
Не нравится:
|
|||
17.12.2018, 14:57 |
|
LINQ - проще
|
|||
---|---|---|---|
#18+
skyANAА во вторых оптимизатор ограничен по времени. Из того, что успел построить, выбрал более подходящий. да не ограничен он ни по какому времени, он ограничен по количеству планов т.к. их миллиард может быть при множестве джойнов. И само значение этого ограничения не жесткое, а зависит от некоторых артефактов, полученных на предыдущих шагах Timeout слово неудачное выбрали, хотя для тех, кто дальше linq не понимает - сойдет ... |
|||
:
Нравится:
Не нравится:
|
|||
18.12.2018, 09:08 |
|
LINQ - проще
|
|||
---|---|---|---|
#18+
skyANALessypМожет вы господа сначала документацию почитаете О чём ты? Давай ссылку, фигли Нет уж, изволь почитать документацию! Какие ещё ссылки? ... |
|||
:
Нравится:
Не нравится:
|
|||
18.12.2018, 18:40 |
|
LINQ - проще
|
|||
---|---|---|---|
#18+
КнюпельskyANAА во вторых оптимизатор ограничен по времени. Из того, что успел построить, выбрал более подходящий. да не ограничен он ни по какому времени, он ограничен по количеству планов т.к. их миллиард может быть при множестве джойнов. И само значение этого ограничения не жесткое, а зависит от некоторых артефактов, полученных на предыдущих шагах Timeout слово неудачное выбрали, хотя для тех, кто дальше linq не понимает - сойдет Таки дайте ссылку, где вместо reasonable time написано про count. Буду признателен. ... |
|||
:
Нравится:
Не нравится:
|
|||
18.12.2018, 22:28 |
|
LINQ - проще
|
|||
---|---|---|---|
#18+
But I see an Optimizer Timeout with a simpler query? Nothing with QO is simple (black and white). There are so many possible scenarios, its complexity so high that it is hard to grasp all of the possibilities. The Query Optimizer may dynamically adjust/set timeout threshold based on the cost of the plan found at a certain stage. For example, if a plan that appears relatively "cheap" is found, then the task limit to search for a better plan may be reduced. Therefore, grossly underestimated cardinality estimation may be one example for hitting an optimizer timeout early. In this case, the focus of investigation is cardinality estimation. This is a rarer case than the scenario that's discussed previously about running a complex query, but it is possible. ... |
|||
:
Нравится:
Не нравится:
|
|||
19.12.2018, 08:17 |
|
LINQ - проще
|
|||
---|---|---|---|
#18+
Dima TНеоднократно сталкивался с тормозами MSSQL в запросах с подзапросами Код: sql 1.
Оптимизатор почему-то строил нездоровый план. В итоге лечил временными таблицами Код: sql 1. 2.
БД большая, некоторые запросы ускорялись в 10 и более раз. И про это там тоже есть :) Re-write the query: Consider breaking up the single multi-table query into multiple queries by using temporary tables. However, you shouldn't always do this, breaking up the query is just one of the ways to simplify the task for the optimizer. See the following sample: Код: sql 1. 2. 3. 4. 5. 6. 7. 8.
To optimize, try to break down into two queries: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.
... |
|||
:
Нравится:
Не нравится:
|
|||
19.12.2018, 10:06 |
|
|
start [/forum/topic.php?fid=17&msg=39749246&tid=1349144]: |
0ms |
get settings: |
11ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
152ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
54ms |
get tp. blocked users: |
1ms |
others: | 15ms |
total: | 270ms |
0 / 0 |