データビュー (Data View) を参照するクエリ (Query) がタイムアウト (Timeout) してしまう場合、効率的なクエリであるかどうかが重要な確認ポイントになります。
例えば、データビューを参照するクエリである場合、where 句のフィールド (EventDate等) に日付関数 (DATEADD 等) や 文字列関数 (CONVERT 等) を多用されている場合があります。
この場合、実行計画が最適化されにくくなり、結果的にリソースを消費し、最後はタイムアウトする傾向が高くなります。
where CONVERT(nvarchar, DATEADD(hour,15,EventDate),120) BETWEEN CONVERT(nvarchar, DATEADD(day, -3, DATEADD(hour,9,SysUtcDateTime())),120) AND CONVERT(nvarchar, DATEADD(hour, 9, SysUtcDateTime()), 120)
where DATEADD(hour,15,EventDate) BETWEEN DATEADD(day -3, DATEADD(hour, 9, SysUtcDateTime())) AND DATEADD(hour, 9, SysUtcDateTime())
where EventDate BETWEEN DATEADD(day -3, DATEADD(hour, -6, SysUtcDateTime())) AND DATEADD(hour, -6, SysUtcDateTime())
where EventDate BETWEEN DATEADD(hour -72, DATEADD(hour, -6, SysUtcDateTime())) AND DATEADD(hour, -6, SysUtcDateTime())
where EventDate BETWEEN DATEADD(hour -78, SysUtcDateTime()) AND DATEADD(hour, -6, SysUtcDateTime())
000384693

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.