일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 프로그래머스 등굣길
- 가장 긴 팰린드롬 파이썬
- SQL SERVER 장비교체
- 게임 개발 파이썬
- 프로그래머스 베스트앨범
- 백준 1167 트리의 지름 파이썬
- 역사 파이썬
- 프로그래머스 순위
- 백준 11054.가장 긴 바이토닉 부분 수열
- 백준 2146 다리 만들기
- 다중 컬럼 NOT IN
- SQL SERVER MIGRATION
- 가장 긴 바이토닉 부분 수열 파이썬
- 등굣길 파이썬
- 프로그래머스 가장 긴 팰린드롬
- 반도체 설계 파이썬
- 램프 파이썬
- 트리의 지름 파이썬
- 백준 1238 파티 파이썬
- 백준 1613 역사
- 베스트앨범 파이썬
- 프로그래머스 순위 파이썬
- 백준 2352 반도체 설계 파이썬
- 순위 파이썬
- 백준 1034 램프 파이썬
- SWEA
- 백준 1516 게임 개발
- 다리 만들기 파이썬
- 프로그래머스 여행경로
- 백준 1043 거짓말 파이썬
Archives
- Today
- Total
공부, 기록
[SQL Server] Insert와 버퍼캐시 본문
테스트 쿼리
SELECT
objects.name AS object_name,
objects.type_desc AS object_type_description,
COUNT(*) AS buffer_cache_pages,
COUNT(*) * 8 / 1024 AS buffer_cache_used_MB
FROM sys.dm_os_buffer_descriptors
INNER JOIN sys.allocation_units
ON allocation_units.allocation_unit_id = dm_os_buffer_descriptors.allocation_unit_id
INNER JOIN sys.partitions
ON ((allocation_units.container_id = partitions.hobt_id AND type IN (1,3))
OR (allocation_units.container_id = partitions.partition_id AND type IN (2)))
INNER JOIN sys.objects
ON partitions.object_id = objects.object_id
WHERE allocation_units.type IN (1,2,3)
and objects.name = 'minjae_test'
AND objects.is_ms_shipped = 0
AND dm_os_buffer_descriptors.database_id = DB_ID()
GROUP BY objects.name,
objects.type_desc
ORDER BY COUNT(*) DESC;
declare @num1 int, @num2 int, @num3 int
set @num1 = 1
set @num2 = @num1 * 10
set @num3 = @num1 * 100
while @num1 < 5000
begin
insert into minjae_test values(@num1,@num2,@num3)
set @num1 = @num1+1
set @num2 = @num1 * 10
set @num3 = @num1 * 100
end
--1회 입력당 12바이트 증가
--5000번 입력시 60,000 바이트 -> 58KB -> 필팩터 80% 약 9개 페이지 증가 예상
--단순 입력
SELECT
objects.name AS object_name,
objects.type_desc AS object_type_description,
COUNT(*) AS buffer_cache_pages,
COUNT(*) * 8 / 1024 AS buffer_cache_used_MB
FROM sys.dm_os_buffer_descriptors
INNER JOIN sys.allocation_units
ON allocation_units.allocation_unit_id = dm_os_buffer_descriptors.allocation_unit_id
INNER JOIN sys.partitions
ON ((allocation_units.container_id = partitions.hobt_id AND type IN (1,3))
OR (allocation_units.container_id = partitions.partition_id AND type IN (2)))
INNER JOIN sys.objects
ON partitions.object_id = objects.object_id
WHERE allocation_units.type IN (1,2,3)
and objects.name = 'minjae_test'
AND objects.is_ms_shipped = 0
AND dm_os_buffer_descriptors.database_id = DB_ID()
GROUP BY objects.name,
objects.type_desc
ORDER BY COUNT(*) DESC;
단순 입력도 버퍼캐시, 트랜잭션 로그를 사용.
예상치 10개 페이지에서 13~14 페이지씩 증가
'공부 > DATABASE' 카테고리의 다른 글
[AWS RDS SQL Server] 데이터 업데이트 작업 (0) | 2024.05.30 |
---|---|
[SQL Server] Index Seek 에서 클러스터드 인덱스 조건이 주는 영향도 (0) | 2024.05.29 |
[RDS SQL Server] 인스턴스 타입 변경 (0) | 2024.05.21 |
[SQL SERVER ] HA 헬스 체크 방식 (0) | 2024.05.14 |
[SQL Server] JOIN 성능 테스트 (0) | 2024.05.09 |