{"id":293120,"date":"2019-08-08T09:00:58","date_gmt":"2019-08-08T09:00:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293120"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293120","title":{"rendered":"\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043d\u0430 secondary \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445 Availability Group"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0412\u0441\u0435 \u043c\u044b \u043b\u044e\u0431\u0438\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Availability Group \u043d\u0430 secondary \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445, \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0431\u044d\u043a\u0430\u043f\u044b \u0438 \u0442.\u0434.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0411\u0414 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435 \u2013 \u044d\u0442\u043e \u0442\u0430 \u0435\u0449\u0451 \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c (\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u043e \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0430\u0445 \u043a\u0430\u043a CDC, \u0434\u043b\u044f \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u043c\u0444\u043e\u0440\u0442\u0430).<\/p>\n<p>  \u041d\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0432\u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f: \u0434\u043e\u0440\u043e\u0433\u043e\u0439 Microsoft, \u043f\u043e\u0437\u0432\u043e\u043b\u044c \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438\u2026 \u043d\u0443 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u044f\u043a\u043e\u0433\u043e.<\/p>\n<h3>\u0412\u0441\u0435\u0433\u0434\u0430* \u0435\u0441\u0442\u044c \u043f\u0443\u0442\u044c, \u0438\u043b\u0438 \u0442\u0438\u043f\u0430 \u0442\u043e\u0433\u043e<\/h3>\n<p><a name=\"habracut\"><\/a><br \/>  <i>*\u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430<\/i><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 Enterprise Edition MS SQL Server:<\/p>\n<ul>\n<li>\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0438\u0445 (\u043d\u0435 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0430\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0435\u2026);<\/li>\n<li>\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 Tempdb (\u0434\u0430, \u0432\u0430\u0448\u0438 \u043c\u043d\u043e\u0433\u043e-\u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438), \u0438\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0411\u0414, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438;<\/li>\n<li>\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e \u043e\u0431\u0435\u0438\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c (\u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0448\u0430\u0440\u0435);<\/li>\n<li>\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 \u0432\u0438\u0434\u0435 BLOB-\u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0437 SQL Server;<\/li>\n<li>\u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 BLOB-\u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e<\/h4>\n<p>  \u0423 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f AG \u043d\u0430 \u043f\u0430\u0440\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0441 SQL Server 2017 (\u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e) \u0438 \u044f \u0441\u043e\u0437\u0434\u0430\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0447\u0443 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443.<\/p>\n<p>  \u0412\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u043d\u0435\u0451 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0441\u0442\u0440\u043e\u043a:<\/p>\n<pre><code class=\"sql\">DROP TABLE IF EXISTS dbo.SampleDataTable;  CREATE TABLE dbo.SampleDataTable (     C1 BIGINT NOT NULL, \tC2 BIGINT NOT NULL, \tCONSTRAINT PK_SampleDataTable PRIMARY KEY (C1) );  INSERT INTO dbo.SampleDataTable WITH (TABLOCK) SELECT t.RN, t.RN \tFROM \t( \t\tSELECT TOP (1000000) ROW_NUMBER() \t\t\tOVER (ORDER BY (SELECT NULL)) RN \t\tFROM sys.objects t1 \t\tCROSS JOIN sys.objects  t2 \t\tCROSS JOIN sys.objects  t3 \t\tCROSS JOIN sys.objects  t4 \t\tCROSS JOIN sys.objects  t5     \t) t \tOPTION (MAXDOP 1);<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 ST_SampleDataTable_C2 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0443 c2<\/p>\n<pre><code class=\"sql\">CREATE STATISTICS ST_SampleDataTable_C2 ON dbo.SampleDataTable(C2);<\/code><\/pre>\n<p>  \u0410 \u043f\u043e\u0442\u043e\u043c \u044f \u0432\u0441\u0442\u0430\u0432\u043b\u044e 1000 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b \u0438 \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043d\u0435 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443.<\/p>\n<pre><code class=\"sql\">set nocount on;  INSERT INTO dbo.SampleDataTable WITH (TABLOCK) SELECT 10000000 + t.RN, 999999999 \tFROM \t( \t\tSELECT TOP (1000) ROW_NUMBER() \t\t\tOVER (ORDER BY (SELECT NULL)) RN \t\tFROM sys.objects t1 \t\tCROSS JOIN sys.objects  t2 \t\tCROSS JOIN sys.objects  t3 \t\tCROSS JOIN sys.objects  t4 \t\tCROSS JOIN sys.objects  t5     \t) t \tOPTION (MAXDOP 1);<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c 1000 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 C2 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 999999999. \u0418 \u044d\u0442\u043e \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 (Ascending Key Problem) \u0438 \u043c\u043d\u0435 \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443\u2026 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435, \u0447\u0442\u043e\u0431\u044b \u044f \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u043b \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b \u0435\u043c\u0443 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0430\u0440\u0443\u044e \u0434\u043e\u0431\u0440\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 DBCC SHOW_STATISTICS, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u043c \u043d\u0430\u0448\u0443 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443.<\/p>\n<pre><code class=\"sql\">DBCC SHOW_STATISTICS('dbo.SampleDataTable', 'ST_SampleDataTable_C2')<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gm\/hx\/xv\/gmhxxvlklhhluczq_s43u1ejo_o.png\"><br \/>  \u0412\u0441\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u0440\u043e\u043b\u0435\u0432\u0441\u0442\u0432\u0435 \u0438 \u043d\u0430\u0448\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u0440\u0430\u0432\u0434\u0430 \u0432 \u043d\u0435\u0439 \u0443\u0447\u0442\u0451\u043d \u0432\u0441\u0435\u0433\u043e 1 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0441\u0442\u0440\u043e\u043a \u0438 \u043d\u0435\u0442 \u0442\u043e\u0439 \u0432\u0440\u0435\u0434\u043d\u043e\u0439 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0451\u0442\u0435, \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u0442\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u00ab\u043f\u043e\u0442\u043e\u043a \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438\u00bb (statistics stream) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 STATS_STREAM \u043a\u043e\u043c\u0430\u043d\u0434\u044b DBCC SHOW_STATISTICS:<\/p>\n<pre><code class=\"sql\">DBCC SHOW_STATISTICS('dbo.SampleDataTable', 'ST_SampleDataTable_C2')  WITH STATS_STREAM;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p8\/rt\/nc\/p8rtncofa5dn602kl7bvexkst0m.png\"><\/p>\n<p>  \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0433\u043e\u0434\u0430\u043c\u0438 \u043f\u0438\u0448\u0443\u0442 \u0431\u043b\u043e\u0433\u0438, \u043d\u043e \u044f \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u0438\u0447\u0430 (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0438 \u043d\u0435 \u043c\u0435\u0448\u0430\u043b\u043e \u043b\u044e\u0434\u044f\u043c \u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f). <\/p>\n<h3>\u041d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435<\/h3>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435 \u0432 tempdb (\u0445\u043e\u0442\u044f \u043c\u043e\u044f AG \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0439\u0442\u0438 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439).<\/p>\n<pre><code class=\"sql\">use TempDB;  DROP TABLE IF EXISTS dbo.SampleDataTable;  CREATE TABLE dbo.SampleDataTable (     C1 BIGINT NOT NULL, \tC2 BIGINT NOT NULL, \tCONSTRAINT PK_SampleDataTable PRIMARY KEY (C1) );  INSERT INTO dbo.SampleDataTable SELECT C1, C2     FROM AvGroupDb.dbo.SampleDataTable;<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432 tempdb \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435.  <\/p>\n<pre><code class=\"sql\">use TempDB; UPDATE STATISTICS ST_SampleDataTable_C2 ON dbo.SampleDataTable(C2) WITH FULLSCAN;<\/code><\/pre>\n<p>  (<i>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430 \u2013 \u041d\u0438\u043a\u043e \u0437\u0430\u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 UPDATE STATISTICS, \u0432\u043c\u0435\u0441\u0442\u043e UPDATE \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c CREATE, \u0442.\u0435. \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f<\/i>)<\/p>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a DBCC SHOW_STATISTICS \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0451:<\/p>\n<pre><code class=\"sql\">DBCC SHOW_STATISTICS('dbo.SampleDataTable', 'ST_SampleDataTable_C2')<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pg\/ai\/n7\/pgain7_73tket3lziu3h3fopk90.png\"><\/p>\n<p>  \u041e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0438\u043d\u0430\u0447\u0435, \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u2013 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 3 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0442\u0438\u0432 178, \u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u043e \u2013 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0438 1000 \u0441\u0442\u0440\u043e\u043a \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u043e\u043b\u0431\u0446\u0430 C2 \u2013 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u0430, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u043e\u0442\u043e\u043a \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438:<\/p>\n<pre><code class=\"sql\">DBCC SHOW_STATISTICS('dbo.SampleDataTable', 'ST_SampleDataTable_C2')  WITH STATS_STREAM;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/04\/0u\/pz\/040upzmtjoezg-ykcnvdvjzzicw.png\"><\/p>\n<p>  \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0433\u0435\u043d\u0438\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u2013 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u044b 5689A0C6 \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c, \u043c\u0435\u0436\u0434\u0443 \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0438\u043c\u0438 \u043d\u0443\u043b\u044f\u043c\u0438 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 EDF10EB4.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u0443\u0434\u0430-\u0442\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b SQL Server \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0443\u0434\u0435\u0441\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b BCP, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b CMDSHELL \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d (\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d-\u0441\u0435\u0440\u0432\u0435\u0440\u0435):<\/p>\n<pre><code class=\"sql\">EXEC xp_cmdshell 'BCP \"DBCC SHOW_STATISTICS(''AvGroupDb.dbo.SampleDataTable'', ''ST_SampleDataTable_C2'') WITH STATS_STREAM\" queryout \\\\SharedServer\\Tempdb\\stats.txt -c -T';<\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0444\u0430\u0439\u043b stats.txt \u0432 \u043d\u0430\u0448\u0435\u0439 \u0448\u0430\u0440\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/io\/3f\/uz\/io3fuz8igpsqphnccpgmf_ghxwq.png\"><\/p>\n<p>  \u0412\u0441\u0435\u0433\u043e-\u0442\u043e \u043f\u0430\u0440\u0430 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442! \u041b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c, \u043b\u0435\u0433\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c.<\/p>\n<h3>\u041d\u0430\u0437\u0430\u0434 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440<\/h3>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 SampleDataTable (\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0436\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0411\u0414, \u0442\u0430\u0431\u043b\u0438\u0446, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a).<\/p>\n<pre><code class=\"sql\">CREATE TABLE dbo.TempStats( \tStats_Stream VARBINARY(MAX), \tRows BIGINT, \tDataPages BIGINT );<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0432 \u043d\u0430\u0448\u0443 \u043d\u043e\u0432\u0443\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0436\u0435 \u043c\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438:<\/p>\n<pre><code class=\"sql\">BULK INSERT dbo.TempStats    FROM '\\\\SharedServer\\Tempdb\\stats.txt'  SELECT *    FROM dbo.TempStats;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nd\/0h\/rk\/nd0hrkomoixkorwndcrijcxlzwu.png\"><\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0435 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043b\u0438 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435, \u043d\u043e \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u2013 \u044d\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430\u0448\u0443 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 UPDATE STATISTICS \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 WITH STATS_STREAM = \u2026<\/p>\n<pre><code class=\"sql\">DECLARE @script NVARCHAR(MAX) SELECT @script = 'UPDATE STATISTICS dbo.SampleDataTable(ST_SampleDataTable_C2) WITH STATS_STREAM = ' + CONVERT(nvarchar(max), [Stats_Stream],1)  \tFROM dbo.TempStats  PRINT @script; EXECUTE sp_executesql @script;<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u0448\u0435 \u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u0434\u0430, \u044f \u0437\u043d\u0430\u044e \u2013 \u044f \u0434\u0435\u043b\u0430\u043b \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0441\u044f \u0441\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430\u043c\u0438, \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438, \u0431\u0430\u0437\u0430\u043c\u0438 \u0438 \u0442.\u0434.), \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e UPDATE STATISTICS, \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0435\u0451 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0438, \u0432 \u0444\u0438\u043d\u0430\u043b\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0451 \u0436\u0435.<br \/>  \u0412\u043e\u0442, \u0447\u0442\u043e \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u044e \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<\/p>\n<pre><code class=\"sql\">UPDATE STATISTICS dbo.SampleDataTable(ST_SampleDataTable_C2) WITH STATS_STREAM = 0x010000000100000000000000000000005689A0C6000000007D020000000000003D020000000000007F0300007F0000000800130000000000000000000000000007000000C5BB2F0172AA000028460F000000000028460F00000000000000803FB4378635000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000030000000100000018000000000000418062744900000000000000410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000190400000000000000000000000000006900000000000000B900000000000000C100000000000000C900000000000000180000000000000033000000000000004E00000000000000100018000000803F000000000000803F0100000000000000040000100018000000803FC02073490000803F0E320F00000000000400001000180000007A44009081450000803FFFC99A3B000000000400000100000079DC280172AA00000000000080842E4140420F0000000000AE000000000000A0924EB33E9BD9BB9DFC19B4404449E6ABFE2F84400000000000408F400000000000000000DFE68293BDC8803F28460F00000000000000000000000000<\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 DBCC SHOW_STATISTICS \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u0430\u0451\u0442 \u043c\u043d\u0435 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0438 \u043d\u0430\u0434\u0435\u044f\u043b\u0441\u044f \u2013 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u043b\u0438 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435. \u041a\u0440\u0443\u0433 \u0437\u0430\u043c\u043a\u043d\u0443\u043b\u0441\u044f.  <\/p>\n<pre><code class=\"sql\">DBCC SHOW_STATISTICS('dbo.SampleDataTable', 'ST_SampleDataTable_C2');<\/code><\/pre>\n<p>  \u041f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043e\u0444\u0438\u0433\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044d\u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u2013 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439, \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e\/\u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u041d\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439.<\/h3>\n<p>  \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e AG \u043c\u0435\u0436\u0434\u0443 \u043e\u0434\u043d\u0438\u043c\u0438 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438, \u0433\u0434\u0435 \u043e\u0434\u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 AG, \u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c BLOB-\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u0443\u044e \u0411\u0414 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ua\/af\/5r\/uaaf5rbrsxkxfq1onfcydtzlgbm.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 AG (AG1 &amp; AG2), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0430 Server1 \u0432 AG1, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0442\u043e \u043d\u0430 Server2 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 (\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0451 dbo.MyTable) \u0432 tempdb, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c, \u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f AG2, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 Server1, \u0433\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u043d\u0430\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443.<\/p>\n<p>  \u0414\u0430, \u0437\u043d\u0430\u044e, \u0437\u0432\u0443\u0447\u0438\u0442 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u043e, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a \u043e \u043a\u0430\u043d\u0430\u043b\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0448\u0430\u0440\u044b.<\/p>\n<h3>\u041c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439<\/h3>\n<p>  \u0423 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435, \u0435\u0441\u043b\u0438 \u044f \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0433\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435? (\u043d\u0443, \u0432\u043e\u043e\u0431\u0449\u0435, \u0438\u0434\u0435\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440)<\/li>\n<li>\u043d\u043e \u0440\u0430\u0437\u0432\u0435 \u043c\u044b, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e, \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0443 (\u0434\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0435\u0442 \u2013 \u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438 \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438)<\/li>\n<li>\u0430 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440? (\u043d\u0435\u0442, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0437\u0430\u0434 \u043f\u0430\u0440\u0443 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448 \u0432\u0435\u043a \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442 \u0438 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442 \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u00ab\u0448\u0442\u043e\u0430?\u00bb) (<i>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430 \u2014 \u0432\u043e\u043e\u0431\u0449\u0435, \u043a\u0430\u043a \u0440\u0430\u0437 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 AG, <a href=\"https:\/\/www.brentozar.com\/archive\/2019\/03\/can-deleting-rows-make-a-table-bigger\/\">\u043c\u043e\u0436\u0435\u043c<\/a><\/i>)<\/li>\n<li>\u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430\u0447\u043d\u0451\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e? (\u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0438\u043b\u0438 \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438). <\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u041a\u0430\u043d\u0430\u043b \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 AG<\/h3>\n<p>  \u042d\u0442\u043e \u043a\u0430\u043d\u0430\u043b \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e \u043e\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u2013 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u0437\u0430\u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 AG, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043e\u0442 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u2013 \u0438 \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u0430\u043d\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0432 \u043f\u043e\u0441\u0442\u0435 <a href=\"https:\/\/blogs.msdn.microsoft.com\/psssql\/2018\/04\/05\/troubleshooting-data-movement-latency-between-synchronous-commit-always-on-availability-groups\/\">Simon Su<\/a>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hc\/my\/rk\/hcmyrkc1okyfr1byzfvhxexwixy.png\"><\/p>\n<p>  \u041a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0435\u0441\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u0430\u043d\u0430\u043b\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438. \u0420\u0435\u043f\u043b\u0438\u043a\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0448\u0430\u0433 12 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0447\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430. \u0422\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043a\u0430\u043d\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0441\u0447\u0451\u0442\u0430 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c tempdb \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u0438, \u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c in-memory \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f (\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0441\u0432\u043e\u0438 In-Memory OLTP Schema-Only \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438\u043b\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u043e NOLOGGING-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0432 Oracle), \u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0434\u0430\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u2013 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u043a\u0440\u0443\u0442\u043e.<\/p>\n<h3>\u041e\u0431\u0449\u0438\u0435 \u043c\u044b\u0441\u043b\u0438<\/h3>\n<p>  \u042d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0442\u043e\u0433\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442 \u2013 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435 \u043a\u0430\u0436\u0434\u044b\u0435 \u043f\u0430\u0440\u0443 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u0434\u0435\u0438 \u2013 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c, \u0442\u0430\u043a\u0438\u043c \u043a\u0430\u043a<\/p>\n<pre><code class=\"sql\">UPDATE STATISTICS dbo.MyAwesomeTable(HugeImportantStatOnC17) WITH FULLSCAN, SECONDARY<\/code><\/pre>\n<p>  \u0433\u0434\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 SECONDARY \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0433\u0434\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.<br \/>  \u0418 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441 \u0431\u044d\u043a\u0430\u043f\u0430\u043c\u0438, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f UPDATE STATISTICS (\u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c) \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445.<\/p>\n<p>  \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043f\u043e\u0434\u0432\u0438\u0433\u043d\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 Enterprise Edition \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e SQL Server, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438.<\/p>\n<p>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u2013 \u044f \u0442\u043e\u0447\u043d\u043e \u0432\u0438\u0436\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Powershell.<\/p>\n<p>  Microsfot, \u0442\u0432\u043e\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c! \ud83d\ude09<\/p>\n<p>  \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0444\u0438\u0447\u0443 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/feedback.azure.com\/forums\/908035-sql-server\/suggestions\/37972738-allow-updating-statistics-on-the-secondary-replica\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a\u0430: \u043b\u044e\u0431\u044b\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443 \u0438 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0435, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  primary replica \u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u044f \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u043b \u00ab\u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c\u00bb, \u0430 secondary replica \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u043f\u043b\u0438\u043a\u043e\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u043d\u043e \u043c\u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0440\u0435\u0436\u0435\u0442 \u0443\u0445\u043e, \u0447\u0435\u043c \u00ab\u043f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f\u00bb \u0438 \u00ab\u0432\u0442\u043e\u0440\u0438\u0447\u043d\u0430\u044f\u00bb \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u043d\u0430 msdn.<\/i><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/462853\/\"> https:\/\/habr.com\/ru\/post\/462853\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0412\u0441\u0435 \u043c\u044b \u043b\u044e\u0431\u0438\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Availability Group \u043d\u0430 secondary \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445, \u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0431\u044d\u043a\u0430\u043f\u044b \u0438 \u0442.\u0434.<\/p>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0411\u0414 \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0435 \u2013 \u044d\u0442\u043e \u0442\u0430 \u0435\u0449\u0451 \u0433\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c (\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u043e \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0430\u0445 \u043a\u0430\u043a CDC, \u0434\u043b\u044f \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u043c\u0444\u043e\u0440\u0442\u0430).<\/p>\n<p>  \u041d\u043e \u0445\u0432\u0430\u0442\u0438\u0442 \u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0432\u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f: \u0434\u043e\u0440\u043e\u0433\u043e\u0439 Microsoft, \u043f\u043e\u0437\u0432\u043e\u043b\u044c \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438\u2026 \u043d\u0443 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u044f\u043a\u043e\u0433\u043e.<\/p>\n<h3>\u0412\u0441\u0435\u0433\u0434\u0430* \u0435\u0441\u0442\u044c \u043f\u0443\u0442\u044c, \u0438\u043b\u0438 \u0442\u0438\u043f\u0430 \u0442\u043e\u0433\u043e<\/h3>\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-293120","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293120","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=293120"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293120\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}