블로그 이미지
보미아빠

카테고리

보미아빠, 석이 (531)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2025.10
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

최근에 올라온 글

'2025/10'에 해당되는 글 2건

  1. 00:59:06 cybord 14 a13v 윈도우 설치
  2. 2025.10.01 deadlock

https://www.msi.com/Laptop/Cyborg-14-A13VX/support?sub_product=Cyborg-14-A13VE#driver

 

MSI Global - The Leading Brand in High-end Gaming & Professional Creation

As a world leading gaming brand, MSI is the most trusted name in gaming and eSports. We stand by our principles of breakthroughs in design, and roll out the amazing gaming gear like motherboards, graphics cards, laptops and desktops.

www.msi.com

 

IRST 드라이버를 설치해야지 디스크가 보임

아래 드라이버를 USB 로 옮겨서 설치

 

 

* 네트워크 없는 환경에서 로컬 계정 셋팅

shift f10
oobe\bypassnro

 

* 윈도우 라이선스 상태확인 

slmgr/dlv

 

* 정품인증 (개인 사용자는 불법이 아니라네?)

https://m.blog.naver.com/iris2733/223042557391

 

KMS를 통한 윈도우 11 정품 인증 방법 -개인사용자 한정

마이크로소프트에서 제공하는 정품 인증 방법으로 KMS(키 관리 서비스) 클라이언트를 이용한 제품 인증 ...

blog.naver.com

 

 

slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX

slmgr /skms kms8.msguides.com

slmgr /ato

slmgr /rearm

 

https://m.blog.naver.com/itcode21/223400197408

 

irm https://get.activated.win | iex

https://wjdtmddnjs6788.tistory.com/792#google_vignette

Posted by 보미아빠
, |

deadlock

카테고리 없음 / 2025. 10. 1. 10:35

Deadlock은 Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait 조건이 모두 만족될 때 발생.

예를 들어, 단일 PK를 가진 테이블에서의 삭제 쿼리와, attachid가 없는 인덱스를 대상으로 하는 UPDATE 구문이 deadlock발생. 이를 해결하기 위해 Two Step 업데이트를 활용.

Two Step 업데이트는 단일 PK를 이용한 단건 삭제와 유사한 방식으로 동작하며, 핵심은 실제 업데이트 대상만을 선별하여 순차적으로 처리할 수 있도록 하는 것에 있다. 이를 통해 deadlock 발생 가능성을 최소화할 수 있음. 사실 View Select 구문에 NOLOCK 보다 UDLOCK 을 거는게 더 좋을수 있다. 그런데, 더이상 deadlock 이 안생기니 그만 보는것으로...

 

-- 기존 쿼리 
(@P0 nvarchar(4000),@P1 int,@P2 int)
update ai set ai.openyn = @P0 
from dbo.CLT_a ai with (index(PK_CLT_a)) 
where ai.clubid = @P1 
and ai.articleid = @P2 
and ai.attachtype = 'I';                           

-- 기존 쿼리 DESC 
/*
attachid 조건이 없어서 articleid 범위를 훑으며 여러 row에 lock 
다른 세션과 락 획득 순서 엇갈림 
deadlock.
*/

-- 개선쿼리 
declare @p0 char(1) = 'N'
	, @p1 int = 10000006
	, @p2 int = 8

update t 
	set t.openyn = @P0
from 
	( 
	select top 100 percent clubid, articleid, attachid 
	from dbo.CLT_a with (nolock, index(idx3_CLT_a_ROS))
	where clubid=@P1 and articleid=@P2 and attachtype='I'
	order by clubid, articleid desc, attachid
	) a 
	inner loop join CLT_a t 
	on a.clubid = t.clubid 
	and a.articleid = t.articleid
	and a.attachid = t.attachid 

-- 개선 쿼리 DESC 
-- two step 업데이트로 항상 PK 단일 행에 대한 업데이트 진행 
-- Mutual exclusion, Hold and wait, No preemption, Circular wait 에서 Circular wait 조건을 제거해 deadlock을 방지한다. 
-- loop join을 강제해 순서를 유지한 update가 되도록 한다. 
idx3_CLT_a_ROS	nonclustered located on PRIMARY	clubid, attachtype, articleid -- view 에서 사용하는 index
PK_CLT_a	clustered, unique, primary key located on PRIMARY	clubid, articleid(-), attachid -- pk update

 

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함