티스토리 뷰

반응형

postgresql에서 대량 이관 작업시 auto vacuum이 켜져 있으면 이관중에 vacuum이 실행되는 문제가 발생하여 이관이 오래 걸림.

 

대상 테이블 autovacuum 끄기

 

select 'alter table '||table_schema||'.'||table_name||' set (autovacuum_enabled=false);'
from information_schema.tables
where table_schema = '스키마명'
 and table_name = '테이블명'
;

 

대상 테이블 autovacuum 다시 켜기

select 'alter table '||table_schema||'.'||table_name||' set (autovacuum_enabled=true);' 
from information_schema.tables 
where table_schema = '스키마명'
 and table_name = '테이블명'
;

 

 

반응형

'DataBase > Postgresql' 카테고리의 다른 글

postgresql 파티션 테이블 생성 및 데이터 이관  (0) 2024.05.09
테이블 사이즈 확인  (0) 2019.08.13
role에 속한 계정 조회  (0) 2019.08.13
postgresql 한글정렬  (0) 2017.10.12
postgresql.conf 간단설정  (0) 2017.10.12