{"id":168597,"date":"2013-02-07T14:13:02","date_gmt":"2013-02-07T10:13:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=168597"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=168597","title":{"rendered":"<span class=\"post_title\">\u041d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Microsoft SQL Server: STATISTICS_ONLY, DBCC AUTOPILOT \u0438 SET AUTOPILOT<\/span>"},"content":{"rendered":"<div class=\"content html_format\">       \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 SQL Server, \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0446\u0435\u043d\u043a\u0443 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438. SQL Server \u0441\u0442\u0440\u043e\u0438\u0442 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u043d\u043e\u0432 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043f\u043b\u0430\u043d \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441. \u0418\u043d\u043e\u0433\u0434\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u043b\u0438\u043a\u0430, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043a\u043e\u0448\u043c\u0430\u0440. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 20 \u043c\u0438\u043d\u0443\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u043c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u043e\u043f\u0440\u043e\u0441 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u00ab\u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439\u00bb \u0438\u043d\u0434\u0435\u043a\u0441? \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>WITH STATISTICS_ONLY<\/h5>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b CREATE INDEX. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"sql\">USE AdventureWorksDW GO CREATE INDEX ix_FirstName ON DimCustomer(FirstName) WITH STATISTICS_ONLY = -1 GO <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 (\u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043f\u043b\u043e\u0442\u043d\u043e\u0441\u0442\u044c) \u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 sys.indexes. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e sp_helpindex \u0438 DBCC SHOWSTATISTICS:<\/p>\n<pre><code class=\"sql\">sp_HelpIndex DimCustomer <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/ed0\/221\/43d\/ed022143df6721d0bddd6a5b9dd03e3e.png\"\/><\/p>\n<pre><code class=\"sql\">DBCC SHOW_STATISTICS(DimCustomer, ix_FirstName) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e2d\/355\/432\/e2d3554322be1f61c23fef1f2697efe1.png\"\/><br \/>  \u0411\u0435\u043d\u0434\u0436\u0430\u043c\u0438\u043d \u041d\u0435\u0432\u0430\u0440\u0435\u0441 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u0438 \u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b <a href=\"http:\/\/sqlblog.com\/blogs\/ben_nevarez\/archive\/2009\/11\/11\/database-engine-tuning-advisor-and-the-query-optimizer.aspx\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  P.S. \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f WITH STATISTICS_ONLY = 0, SQL Server \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443. \u0422\u043e\u043b\u044c\u043a\u043e \u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0434\u0435\u043a\u0441.<\/p>\n<h5>DBCC AUTOPILOT \u0438 SET AUTOPILOT<\/h5>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u043a\u0430\u043a \u043d\u0430\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u044f\u0432\u043d\u043e, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0445\u0438\u043d\u0442\u0430:  <\/p>\n<pre><code class=\"sql\">SELECT * FROM DimCustomer WITH(index=ix_FirstName) WHERE FirstName = N'Eugene' <\/code><\/pre>\n<p>  \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443:<br \/>  <code>Msg 308, Level 16, State 1, Line 1 Index 'ix_FirstName' on table 'DimCustomer' (specified in the FROM clause) does not exist.<\/code><\/p>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c Index ID?   <\/p>\n<pre><code class=\"sql\">SELECT * FROM DimCustomer WITH(index=5) WHERE FirstName = N'Eugene' <\/code><\/pre>\n<p>  \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435:<br \/>  <code>Msg 307, Level 16, State 1, Line 1 Index ID 5 on table 'DimCustomer' (specified in the FROM clause) does not exist.<\/code><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441?<\/p>\n<p>  \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c-\u0442\u043e \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u0437\u0430\u0431\u0430\u0432\u0430.<\/p>\n<p>  DBCC AUTOPILOT \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440\u0443, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043b\u0430\u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u042d\u0442\u0430 DBCC, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0444\u043b\u0430\u0433\u043e\u043c SET AUTOPILOT ON \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"sql\">SET AUTOPILOT ON|OFF \/*     DBCC TRACEON (2588)     DBCC HELP('AUTOPILOT') *\/ DBCC AUTOPILOT (typeid [, dbid [, {maxQueryCost | tabid [, indid [, pages [, flag [, rowcounts]]]]} ]]) <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c<\/h5>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<pre><code class=\"sql\">-- Current Cost = 0,762133 -- Clustered Index Scan on pk SELECT * FROM DimCustomer WHERE FirstName = N'Eugene' GO <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/b38\/c40\/495\/b38c40495245c256752f33be601e96d5.png\"\/><\/p>\n<pre><code class=\"sql\">-- creating the index  -- DROP INDEX ix_FirstName ON DimCustomer CREATE INDEX ix_FirstName ON DimCustomer(FirstName) WITH STATISTICS_ONLY = -1 GO -- Looking at the info necessary in the DBCC AUTOPILOT comand SELECT name, id, Indid, Dpages, rowcnt  FROM sysindexes WHERE id = object_id('DimCustomer') GO <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a28\/ea3\/39f\/a28ea339fa996fc9deb7873e452d7c40.png\"\/><\/p>\n<pre><code class=\"sql\">DBCC AUTOPILOT (5, 9, 0, 0, 0, 0, 0) -- Starting with the TypeID 5 DBCC AUTOPILOT (6, 9, 37575172, 1, 0, 0, 0) -- Clustered Index with TypeID 6 DBCC AUTOPILOT (0, 9, 37575172, 2, 0, 0, 0) -- All other index with TypeID 0 DBCC AUTOPILOT (0, 9, 37575172, 3, 0, 0, 0) -- All other index with TypeID 0 DBCC AUTOPILOT (0, 9, 37575172, 5, 0, 0, 0) -- All other index with TypeID 0 GO SET AUTOPILOT ON GO -- Query to create the estimated execution plan with the cost = 0,0750712 SELECT * FROM dbo.DimCustomer WHERE FirstName = N'Eugene' OPTION (RECOMPILE) GO SET AUTOPILOT OFF GO <\/code><\/pre>\n<p>  <i>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u0427\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 TypeID, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0435\u0441\u0442\u044c \u043d\u0438\u0436\u0435, \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0430\u0432\u0442\u043e\u0440, \u043f\u0438\u0448\u0435\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u00ab\u0430\u0432\u0442\u043e\u043f\u0438\u043b\u043e\u0442\u0430\u00bb, \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c 0<\/i><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/be6\/65a\/58c\/be665a58ce74288711e26e41a7ed7d45.png\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/669\/6aa\/2ea\/6696aa2ea28f52b569c7dd863ebb300a.png\"\/><br \/>  \u0422\u0430\u043a \u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 DBCC AUTOPILOT, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 Pages \u0438 RowCount. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0440\u0430\u0432\u043d\u044b\u043c\u0438 \u043d\u0443\u043b\u044e, \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0435 \u0436\u0435, \u043a\u0430\u043a \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430.<\/p>\n<h5>\u0412\u044b\u0432\u043e\u0434\u044b<\/h5>\n<p>  \u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u00ab\u0431\u0435\u043b\u044b\u0445 \u043f\u044f\u0442\u0435\u043d\u00bb, \u043d\u043e \u044f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<p>  \u042f \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0438\u0433\u0440\u0430\u044e\u0441\u044c \u0441 \u044d\u0442\u043e\u0439 \u0448\u0442\u0443\u043a\u043e\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0438\u043b\u0438 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0418 \u0432\u0430\u043c \u0432\u0435\u0434\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445? \u042d\u0442\u043e \u043d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442, \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u043f\u0430\u0440\u043d\u0438 \u0438\u0437 Microsoft \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u0435\u0451 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439.<\/p>\n<p>  <i>\u041e\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430:<br \/>  \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044f\u0441\u044c \u043a \u0430\u0432\u0442\u043e\u0440\u0443, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c.<br \/>  \u0422\u0430\u043a \u0436\u0435, \u0445\u043e\u0447\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0442\u043e\u0433\u043e \u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u0430: <a href=\"http:\/\/www.simple-talk.com\/sql\/database-administration\/hypothetical-indexes-on-sql-server\/\">Hypothetical Indexes on SQL Server<\/a>. \u042d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u0430\u044f, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0442\u043e\u0433\u043e \u0436\u0435 \u043f\u043e\u0441\u0442\u0430. \u041f\u043e\u0447\u0435\u043c\u0443 \u044f \u043f\u0435\u0440\u0435\u0432\u0451\u043b \u043d\u0435 \u0435\u0451? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0443\u0442\u044c \u0443 \u043d\u0438\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f, \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u2014 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0432 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043e\u043d \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 CLR, \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f DBCC AUTOPILOT, \u0447\u0442\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<br \/>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0438 \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0432\u0437\u044f\u0442\u044b \u043c\u043d\u043e\u0439 \u0443 \u0430\u0432\u0442\u043e\u0440\u0430, \u043d\u0430 \u043c\u043e\u0451\u043c SQL Server 2005 SP4 \u043e\u043d \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u043f\u0438\u043b\u0438\u0432\u0430\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WITH STATISTICS_ONLY \u0432\u043c\u0435\u0441\u0442\u043e WITH STATISTICS_ONLY = -1), \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 SQL Server 2005 \u0438 \u0441\u0442\u0430\u0440\u0448\u0435 (\u0438\u043c\u0435\u043d\u043d\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 2005-\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Database Tuning Advisor, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b).<br \/>  \u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043b\u044e\u0431\u044b\u0435 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u0438 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<br \/>  <\/i>        \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/168597\/\"> http:\/\/habrahabr.ru\/post\/168597\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">       \u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 SQL Server, \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u0446\u0435\u043d\u043a\u0443 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438. SQL Server \u0441\u0442\u0440\u043e\u0438\u0442 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u043d\u043e\u0432 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043f\u043b\u0430\u043d \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0435\u043a\u0441. \u0418\u043d\u043e\u0433\u0434\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u043b\u0438\u043a\u0430, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043a\u043e\u0448\u043c\u0430\u0440. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043b\u0435 20 \u043c\u0438\u043d\u0443\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u043c\u044b \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u043e\u043f\u0440\u043e\u0441 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u00ab\u0433\u0438\u043f\u043e\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439\u00bb \u0438\u043d\u0434\u0435\u043a\u0441? \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-168597","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/168597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168597"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/168597\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=168597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=168597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}