shrink_over_allocated_columns_* 세션 설정

shrink_over_allocated_columns_* 세션 설정

이 페이지에서는 과잉 할당된 컬럼을 줄이는 shrink_over_allocated_columns_* 세션 설정들을 다뤄요. INSERT 시 메모리 낭비를 줄이기 위해 컬럼을 줄일 최소 낭비량과 비율을 설정해요. 이 설정들은 system.settings 테이블에서 확인할 수 있으며 ClickHouse 소스에서 자동 생성돼요.

출처: 문서

본문

이 설정들은 system.settings에서 확인할 수 있으며 소스에서 자동 생성돼요.

shrink_over_allocated_columns_min_waste_bytes

INSERT 시 컬럼을 맞춰 줄이기 위한, 컬럼의 낭비된(예약됐지만 사용되지 않은) 메모리의 최소 절대량(바이트)이에요. shrink_over_allocated_columns_min_waste_ratio를 참고하세요. 과잉 할당이 작아서 메모리 절약이 비용을 정당화하지 못하는 컬럼을 재할당하지 않도록 해요.

shrink_over_allocated_columns_min_waste_ratio

INSERT 시 과잉 할당된 컬럼(가변 길이 컬럼의 2의 거듭제곱 성장 때문에 예약 메모리가 사용 메모리를 초과하는 컬럼)은 비용이 큰 materialization과 파트 쓰기 단계 전에 맞춰 줄여져서 최고 메모리 사용량을 줄여요. 컬럼은 allocatedBytes() > byteSize() * shrink_over_allocated_columns_min_waste_ratio이고 절대 낭비량이 최소 shrink_over_allocated_columns_min_waste_bytes 이상일 때만 줄어져요. 가능한 값:

  • 1보다 큰 부동소수점.

  • 1 이하 값은 줄이기를 비활성화해요(기본값 1.0은 비활성화를 유지해요).

더 알아보기 (Learn more)