豢豌: http://purumae.tistory.com/174

伎 蠍 るゼ 危エ覲伎る 企 _150TrickEnableFlag 貉殊 企 讌 螻 螻 蟆 螳給.

-- Dialog Pool れ 企 
CREATE TABLE dbo.DialogPoolConfig (
_150TrickEnableFlag bit NOT NULL,
DialogCount int NOT NULL
);
GO



P_StartUp_CreateDialogs 伎 螳譯.
CREATE PROCEDURE dbo.P_StartUp_CreateDialogs 
AS
SET NOCOUNT ON;
SET XACT_ABORT ON;
 
DECLARE @i int = 1
    , @intDialogCount int = 0
    , @bit150TrickEnableFlag bit
    , @uidDialogHandle uniqueidentifier;
 
SELECT @intDialogCount = DialogCount * (CASE _150TrickEnableFlag WHEN 0 THEN 1 ELSE 150 END)
    , @bit150TrickEnableFlag = _150TrickEnableFlag
FROM dbo.DialogPoolConfig;
 
TRUNCATE TABLE dbo.DialogPool;
 
WHILE @i <= @intDialogCount
BEGIN
    BEGIN DIALOG CONVERSATION @uidDialogHandle
        FROM SERVICE InitDBService
        TO SERVICE N'TargetDBService'
        ON CONTRACT LoggingContract
        WITH ENCRYPTION = OFF;
 
    IF @bit150TrickEnableFlag = 0 OR (@bit150TrickEnableFlag = 1 AND (@i % 150) = 0)
        INSERT dbo.DialogPool (DialogHandle)
        VALUES (@uidDialogHandle);
 
    SET @i += 1;
END
GO

_150TrickEnableFlag 貉殊 螳 "1"企 DialogCount 螳 150覦一 企麹 Dialog Handle 燕.

蠏碁Μ螻, 螳.. 襷 150覯讌語 碁る DialogPool 企 INSERT .

IF @bit150TrickEnableFlag = 0 OR (@bit150TrickEnableFlag = 1 AND (@i % 150) = 0) 
    INSERT dbo.DialogPool (DialogHandle)

    VALUES (@uidDialogHandle);


讀, 150 Trick企..


( Dialog Handle ) x (150) 螳 Dialog Handle 燕螻, 襷 150覯讌語 碁る 蟆



蠏碁磯.. 企蟆 覃 覘螳 譬讌る 蟇瑚???

伎手鍵 豢覦 企給.

企 螳覦 SSB襦 覃讌襯 ″ ろ碁ゼ 給.
(讌 ろ語 る 焔 豕襯 蠍磯蓋 蟇伎 螳豢 給.)

蠏碁磯, INITIATOR 覯 wait stat 危エ覲企 PAGELATCH_EX/SH螳 蠎蠍一 蟆.
企 企螳 page latch螳 螻 蟇碁.. 企 誤 wait螳 覲覈 蟇一.

伎 ろ語 sys.sysdesend 企 瑚 給.

企 INITIATOR 覯 ″ 覃讌襯 碁 螳 ロ螻, 襯 UPDATE , 瑚 page latch 企 覦 覓語.

覃讌螳 襷 sysdesend 企 update伎狩, Thread襷 碁れ 覿襴ろ企.. 碁れ 伎 覈磯 る.. page latch螳 蟇碁 焔 覓語襯 手鍵蟆 .


覓語襯 願屋る Thread 豪 Dialog Handle 覈 蠍磯 伎襯 螳螻 朱 蟆譯.

覦覯 企 襷 る 朱, 磯Μ 蠏碁 覦覯 朱讌 豐 襷豢 覲願給.

襾殊 sysdesend 企 伎 螳給.


column name data type null option size
handle uniqueidentifier not null 16|
diagid uniqueidentifier not null 16
initiator tinyint not null 1
sendseq bigint not null 8
sendxact binary not null 6


- handle 貉殊 unique clustered 碁煙り 給.
- 焔 handle 螳 谿. (讀, page split 覦讌 給.)


覈 貉殊 螻 蠍語危 一危 螻 NULL 讌 給.
貊螳 谿讌 螻糾 一危郁 47byte (16 + 16 + 1 + 8 + 6)願 row overhead 7byte, row offset 2byte譯.
96 byte る襯 螻ろ覃, 蟆郁記 page れ願 貊 豕 144螳. (page 32 byte 螻糾 給.)
襷 144覯讌 焔 Dialog Handle襷 Pool l 螳 Thread 麹 譴る, Pool 覈 碁れ sysdesend 企 覈 襦 るジ page 蟆 .
蠏 蟆郁骸襦 page latch覓語襯 願屋 給.

企蟆覲企 144 Trick 襷.. 蟲褐 150 Trick朱 企讌螻 150覯讌 Dialog Handle 伎 覈襯伎給.
144 150 覃 page螳 覈 螳 觜讌襷.. 覓伎 襷 譴願, 144覲企る 150企朱 螳 覲企 豺伎 蠍 覓語 蟾 讌 覺.
蠏碁 144 Trick , 150 Trick 蠏碁襦 螳襴暑.
(伎襯 覦蟆る 蠍 覿襴暑~)




150 Trick 襷レ ?!
豐 150 Trick 伎 PAGELATCH_EX/SH襦 誤 Hot-Spot 伎 覓語.
譟郁唄 磯 るゴ讌襷 150 Trick 覃 豐 覃語 螳 豕 3覦 螳 螳.
讌襷, 碁 螳 蟇磯 ″ 覃讌螳 豢覿 殊.. Hot-Spot 伎螳 殊企讌 る ろ 150 Trick 蟆 襴蟆譯.
覿蟆 襷 伎襯 覩襦 I/O螳 讀螳蠍 覓語.
旧 15螳 覩碁 Thread 豐 ″ 覃讌 150 Trick り .

れ ろ語 襷讌襷 譯殊 SSB襯 覲旧襯 る覲願給.
( 覦 給. ^^)