SlideShare a Scribd company logo
1 of 23
Download to read offline
PostgreSQL Architecture
2022년 11월 12일 놀러가기 좋은 토요일 오후
CONTENTS
01. 발표자 소개
02. PostgreSQL 구조
03. PostgreSQL Cluster
04. PostgreSQL - Process
05. PostgreSQL - Memory
06. PostgreSQL - File Layout
발표 시작 합니다
1. 발표자 소개
윤성재 (공작명왕, gongjak@gmail.com )
리눅스 엔지니어,
Service Administrator,
Database 운영 Administrator
Cloud Solutions Architecture (AWS / GCP)
1984년 Apple II 와 만남
1994년 Linux (Slackware)와 만남
1997년 070 서비스 개발자로 IT 업무 시작
2009년 DBA로 업무 시작
2013년 Cloud 세상에 첫걸음 (AWS/GCP)
2015년 PostgreSQL을 실제 서비스에 처음 적용해 봄
2016년 처음으로 책을 써 봄
2018년 Cassandra로 No SQL 운영
2020년 GCP Solutions Architect로 근무 중
1. 발표자 소개
발표자가 몸 담고 있는 곳 - CLOUDGRAM 소개
2. PostgreSQL 구조
PostgreSQL의 Client – Server 모델
Command : psql
3. PostgreSQL Cluster
PostgreSQL Cluster Structure
- PostgreSQL 공식 문서 :
각 Table은 rows의 모음이고,
각 rows는 columns 의 집합이고,
각 columns은 특정 데이터 유형입니다.
Table은 databases 안에 존재하고,
이 databases의 모음을 하나의
PostgreSQL 서버가 관리 합니다.
이 하나의 서버가 관리하는 database
집합 단위를 Cluster 라 합니다.
initdb -D /usr/local/pgsql/data
3. PostgreSQL Cluster
Roles
• Roles는 Users/Groups를 모두 포괄하는 개념
• PostgreSQL 8.1 이전 버전에서는 사용자와
그룹이 별개의 개체였지만 이후에 Role로 통합됨.
• 유저 생성, 그룹 생성, 권한 부여 등이 모두 role
기반
• 설정 방법에 따라 사용자 또는 그룹으로 가능
• 모든 Role은 사용자, 그룹 또는 둘 다의 역할을 할
수 있습니다.
• 처음 설치 시 기본으로 postgres 유저가 생성됨
du
du+
SELECT * FROM pg_user;
3. PostgreSQL Cluster
Databases
• 처음 설치 시 postgres, templete0, templete1
3개의 database가 기본으로 생성됨
• PostgreSQL의 Database는 여러 schema로 구성
• Schemas는 Tables, Views, Sequences,
Synonyms, Domains, Functions, Procedures 등과
같은 Object 들의 논리적인 집합
l
l+
SELECT * FROM pg_database;
3. PostgreSQL Cluster
Databases - schemas
Server > PostgreSQL 14 (Cluster) > Databases
> Schemas > Tables > Rows > Columns
• Oracle Database는 User가 Schema 임
• MySQL은 Schema와 Database가 동일
• Role 을 이용하여 권한을 부여할 때 반드시
Database > Schema > Table의 순서로
부여해줘야 함
c {database_name}
dn
dn+
SELECT * FROM pg_user;
3. PostgreSQL Cluster
Tablespaces
• PostgreSQL에서의 Tablespace는 파일이
위치하는 경로
• Tablespace는 Oracle Database, PostgreSQL에서
사용되며, MySQL, MS-SQL에는 없는 개념
• PostgreSQL에서는 PGDATA라는 환경변수에
지정된 폴더 전체를 Database에서 사용하고
있으며, 테이블은 그 하위에 폴더와 파일로 생성
• Tablespace를 사용하여 관리자는 PostgreSQL의
디스크 레이아웃을 제어
• 설치 시 “pg_default”, “pg_global” 2개의
Tablespace가 기본으로 생성
db
db+
SELECT * FROM pg_tablespace;
4. PostgreSQL - Process
Basic Architecture
1. postgres(Daemon) process
2. Background(Utility) process
3. Backend process
4. Client process
Client postgres
(구.Postmaster)
Backend
Processes
Shared Memory
Shared Buffers
WAL Buffers
CLOG Buffers Temp Buffers
Other Buffers
Physical Files
Background(Utility) Processes
Writer
Check
pointer
WAL
Writer
Archiver
Process
Logging
Collector
Stats
Collector
Autovacuum
Launcher
WAL Files
Data Files
Log Files
Archive Files
fork()
참조: https://dbsguru.com/postgresql-architecture-process/
4. PostgreSQL - Process
Postgres (구. Postmaster) Process
• PostgreSQL Cluster의 첫 번째
프로세스
• 하나의 Cluster에 대해 하나의
postgres(server process)가 존재
• postmaster는 버전 8.1.23까지
사용되었으며, 버전 8.2부터는
postgres로 실행
ps -ef| grep postgres
pstree | grep post
pstree {postgres의 PID}
pstree -p {postgres의 PID}
4. PostgreSQL - Process
Background (Utility) Processes
• Logging Collector
stderr로 전송된 로그 메시지를 캡처하고 로그 파일로 재전송
설정 파일의 logging_collector 매개변수로 설정하며, 기본값은 off.
적용을 위해 재시작 필요.
• Stats Collector
DBMS의 세션 정보, 테이블 통계 같은 정보를 수집
통계 정보는 운영중에 pg_stat_tmp 폴더의 파일에 저장하고, DB가
중지되면 pg_stat 폴더로 복사하고, DB가 시작되면 pg_stat 폴더에 있는
것을 pg_stat_tmp 폴더로 복사함.
15버전에서는 이 절차가 사라짐.
• Autovacuum Launcher
Vacuum 이 필요할 때 autovacuum worker를 fork 함
설정 파일의 매개변수 autovacuum 으로 설정하며, 기본값은 on.
• WAL(Write-Ahead Logging) writer
WAL Buffers의 내용을 WAL files에 기록
• Archiver
Archiving 모드일 경우, 재활용할 WAL 파일을 archive_command에서
지정한 방식으로 처리함.
설정 파일의 매개변수 archive_mode 로 설정하며, 기본값은 off.
적용을 위해 재시작 필요.
4. PostgreSQL - Process
Background (Utility) Processes
background writer
• 주기적으로 Shared Buffers의 Dirty
Data page를 물리적인 data file에
기록
checkpointer
• Checkpoint 발생시 Shared Buffers의
Dirty Data page을 data file에 기록
• 많은 I/O(Input/Output) 발생 가능
• 발생조건
ü checkpoint_timeout (300초)
ü 트랜잭션 로그(WAL 파일, 1GB)
전체 크기가 max_wal_size 값을
초과
Client postgres
(구.Postmaster)
Backend
Processes
Shared Memory
Shared Buffers
WAL Buffers
CLOG Buffers Temp Buffers
Other Buffers
Physical Files
Background(Utility) Processes
Writer
Check
pointer
WAL
Writer
Archiver
Process
Logging
Collector
Stats
Collector
Autovacuum
Launcher
WAL Files
Data Files
Log Files
Archive Files
fork()
참조: https://dbsguru.com/postgresql-architecture-process/
4. PostgreSQL - Process
Background (Utility) Processes
WAL(Write-Ahead Logging) writer
• WAL Buffers의 내용을 WAL files에
기록
Archiver
• Archiving 모드일 경우, 재활용할 WAL
파일을 archive_command에서 지정한
방식으로 처리
• 설정 파일의 매개변수 archive_mode
로 설정 (기본값은 off. 적용시 재시작
필요)
Client postgres
(구.Postmaster)
Backend
Processes
Shared Memory
Shared Buffers
WAL Buffers
CLOG Buffers Temp Buffers
Other Buffers
Physical Files
Background(Utility) Processes
Writer
Check
pointer
WAL
Writer
Archiver
Process
Logging
Collector
Stats
Collector
Autovacuum
Launcher
WAL Files
Data Files
Log Files
Archive Files
fork()
참조: https://dbsguru.com/postgresql-architecture-process/
4. PostgreSQL - Process
Background (Utility) Processes
Logging Collector
• stderr로 전송된 로그 메시지를 캡처하고
로그 파일로 재전송
• 설정 파일의 logging_collector 로 설정
(기본값은 off. 변경시 재시작 필요)
Stats Collector
• DBMS의 세션 정보, 테이블 통계 같은
정보를 수집
• DB 운영 중: pg_stat_tmp 폴더의 파일에
저장
• DB가 중지 : pg_stat 폴더로 복사
• DB가 시작 : pg_stat 폴더에 있는 것을
pg_stat_tmp 폴더로 복사
• 15버전에서는 이 절차가 사라짐.
Autovacuum Launcher
• Vacuum 이 필요할 때 autovacuum
worker를 fork 함
• 설정 파일의 매개변수 autovacuum 으로
설정하며, 기본값은 on.
Client postgres
(구.Postmaster)
Backend
Processes
Shared Memory
Shared Buffers
WAL Buffers
CLOG Buffers Temp Buffers
Other Buffers
Physical Files
Background(Utility) Processes
Writer
Check
pointer
WAL
Writer
Archiver
Process
Logging
Collector
Stats
Collector
Autovacuum
Launcher
WAL Files
Data Files
Log Files
Archive Files
fork()
참조: https://dbsguru.com/postgresql-architecture-process/
4. PostgreSQL - Process
Backend Process & Client Process
Client Process
• 사용자가 PostgreSQL에 접속하기 위해 사용하는 모든 응용프로그램
• 사용자의 OS 환경과 취향에 따라 여러 프로그램
• 대표 응용프로그램: psql 등
Backend Process
• 모든 Backend 사용자 연결에 할당되는 Background process를 의미
• Client의 요청시 postgres main process(구. postmaster)에서 사용자
연결을 위해 postgres process를 분기(fork)
• 사용자의 SQL과 Command 요청을 수행하여 결과를 전송
• 사용자 프로세스와 1:1 로 생성됨
• 매개변수 max_connections 의 값만큼 동시 연결이 가능하며, 기본값은
100.
• 쿼리 실행에는 일부 메모리(Local Memory)가 필요함
5. PostgreSQL – Memory
Memory Components of PostgreSQL
Shared Memory
Shared Buffers
WAL Buffers
CLOG Buffers
Lock Space
Other Buffers
Per backend memory
Maintanance_work_mem
temp_Buffer
work_mem
catalog_cache
Optimizer / executor
OS Cache
PostgreSQL 메모리 구성요소 2가지
Share Memory
• 데이터베이스의 캐싱 및 트랜잭션 로그 캐싱을
위해 예약된 메모리
• 모든 프로세스가 공유하여 사용하는 공간
• 설정(config)의 매개변수 4개 영역
ü Shared Buffers
ü WAL(Write-Ahead Logging) Buffers
ü Clog(Commit log) Buffer
ü Lock Space (Memory for Locks)
Backend Memory (Process Memory)
• Backend process가 요청 받은 Query를 실행하기
위한 메모리( = Local Memory )
• 설정(config)의 매개변수
ü work_mem(기본값 4MB)
ü Maintenance_work_mem(기본값 64MB)
ü temp_buffers(기본값 8MB)
6. PostgreSQL – File Layout
환경변수 PGDATA에 의해 저장됨
아이템 설명
PG_VERSION PostgreSQL 의 major 버전 번호가 포함된 파일
base 데이터베이스별 하위 디렉터리를 포함하는 하위 디렉터리
current_logfiles 로깅 수집기가 현재 기록한 로그 파일을 기록하는 파일
global pg_database와 같은 클러스터 전체 테이블을 포함하는 하위 디렉토리
pg_commit_ts 트랜잭션 커밋 타임스탬프 데이터가 포함된 하위 디렉터리
pg_dynshmem 동적 공유 메모리 하위 시스템에서 사용하는 파일을 포함하는 하위 디렉터리
pg_logical 논리적 디코딩을 위한 상태 데이터를 포함하는 하위 디렉토리
pg_multixact 다중 트랜잭션 상태 데이터를 포함하는 하위 디렉터리 (공유 행 잠금에 사용됨)
pg_notify LISTEN/NOTIFY 상태 데이터를 포함하는 하위 디렉토리
pg_replslot 복제 슬롯 데이터를 포함하는 하위 디렉토리
pg_serial 커밋된 직렬화 가능한 트랜잭션에 대한 정보를 포함하는 하위 디렉토리
pg_snapshots 내보낸 스냅샷이 포함된 하위 디렉토리
6. PostgreSQL – File Layout
환경변수 PGDATA에 의해 저장됨
아이템 설명
pg_stat 통계 하위 시스템에 대한 영구 파일을 포함하는 하위 디렉터리
pg_stat_tmp 통계 하위 시스템에 대한 임시 파일을 포함하는 하위 디렉토리
pg_subtrans 하위 트랜잭션 상태 데이터를 포함하는 하위 디렉토리
pg_tblspc 테이블스페이스에 대한 심볼릭 링크를 포함하는 하위 디렉토리
pg_twophase 준비된 트랜잭션에 대한 상태 파일을 포함하는 하위 디렉토리
pg_wal WAL(Write Ahead Log) 파일을 포함하는 하위 디렉토리
pg_xact 트랜잭션 커밋 상태 데이터를 포함하는 하위 디렉터리
postgresql.auto.conf ALTER SYSTEM에서 설정한 구성 매개변수를 저장하는 데 사용되는 파일
postmaster.opts 서버가 마지막으로 시작된 명령줄 옵션을 기록하는 파일
postmaster.pid
현재 포스트마스터 프로세스 ID(PID), 클러스터 데이터 디렉토리 경로, 포스트마스터
시작 타임스탬프, 포트 번호, Unix 도메인 소켓 디렉토리 경로(비어 있을 수 있음), 첫
번째 유효한 listen_address(IP 주소 또는 *, 그렇지 않은 경우 비어 있음)를 기록하는
잠금 파일 TCP에서 수신 대기) 및 공유 메모리 세그먼트 ID(이 파일은 서버 종료 후
존재하지 않음)
[참고] PostgreSQL 15: Stats Collector Gone?
이제 통계 수집기가 사라졌습니다.
What?
• 쿼리 플랜에 사용되는 table-level statistics
collection(ANALYZE)와 혼동하는 기능
• 테이블이나 인덱스가 스캔한 횟수, 테이블에서 마지막 vacuum
또는 autovacuum이 실행된 횟수 등과 같은 누적 통계를 얻기
위해 각 프로세스의 모든 활동을 추적
• pg_stat_* 를 통해 확인
Wrong?
• 세션의 Backend process는 수행한 활동을 UDP 소켓을 통해
전송
ü 오래된 통계
ü 통계 수집기가 실행되지 않음
ü autovacuum이 작동하지 않거나 시작하지 않음
• pg_stat_tmp 폴더에 대량의 IO가 발생할 수 있음
New
• PostgreSQL 15에서 통계는 파일과 파일 시스템 대신 동적
공유 메모리를 사용
• 이제 통계 수집기는 제거 대상임
• 참조 : Andres Freund의 commit 내용
(https://git.postgresql.org/gitweb/?p=postgresql.git;h=5891c7a
8e)
• 재 시작시 종료 직전에 체크포인터 프로세스에 의해 파일
시스템에 기록되고 시작 프로세스에 의해 시작하는 동안 다시
로드됨.
• 충돌이 발생하면 통계가 삭제됨
Getting Better
• 통계 수집기의 오버헤드와 유지관리가 사라지면서
autovacuum과 같은 하위 시스템의 할 일이 줄어듬
• 통계 정보를 자주 조회하는 모니터링 도구는 시스템 부하를
훨씬 덜 유발할 것으로 예상됨
Thank you

More Related Content

What's hot

[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google CloudPgDay.Seoul
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and OptimizationPgDay.Seoul
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performancePostgreSQL-Consulting
 
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자PgDay.Seoul
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우PgDay.Seoul
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015PostgreSQL-Consulting
 
PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuningelliando dias
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스PgDay.Seoul
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?Mydbops
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep InternalEXEM
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PGPgDay.Seoul
 
PLPgSqL- Datatypes, Language structure.pptx
PLPgSqL- Datatypes, Language structure.pptxPLPgSqL- Datatypes, Language structure.pptx
PLPgSqL- Datatypes, Language structure.pptxjohnwick814916
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기PgDay.Seoul
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기I Goo Lee
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresqlbotsplash.com
 

What's hot (20)

[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우Mvcc in postgreSQL 권건우
Mvcc in postgreSQL 권건우
 
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
 
PostgreSQL Performance Tuning
PostgreSQL Performance TuningPostgreSQL Performance Tuning
PostgreSQL Performance Tuning
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
 
PLPgSqL- Datatypes, Language structure.pptx
PLPgSqL- Datatypes, Language structure.pptxPLPgSqL- Datatypes, Language structure.pptx
PLPgSqL- Datatypes, Language structure.pptx
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기
 
5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance5 Steps to PostgreSQL Performance
5 Steps to PostgreSQL Performance
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
 

Similar to [pgday.Seoul 2022] PostgreSQL구조 - 윤성재

DBMS 아키텍처
DBMS 아키텍처DBMS 아키텍처
DBMS 아키텍처HaksunLEE6
 
Tajo and SQL-on-Hadoop in Tech Planet 2013
Tajo and SQL-on-Hadoop in Tech Planet 2013Tajo and SQL-on-Hadoop in Tech Planet 2013
Tajo and SQL-on-Hadoop in Tech Planet 2013Gruter
 
그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조Choonghyun Yang
 
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4Seok-joon Yun
 
AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)Amazon Web Services Korea
 
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
SQL-on-Hadoop with Apache Tajo,  and application case of SK TelecomSQL-on-Hadoop with Apache Tajo,  and application case of SK Telecom
SQL-on-Hadoop with Apache Tajo, and application case of SK TelecomGruter
 
(120128) #fitalk sql server anti-forensics
(120128) #fitalk   sql server anti-forensics(120128) #fitalk   sql server anti-forensics
(120128) #fitalk sql server anti-forensicsINSIGHT FORENSIC
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Web Services Korea
 
Big data analysis with R and Apache Tajo (in Korean)
Big data analysis with R and Apache Tajo (in Korean)Big data analysis with R and Apache Tajo (in Korean)
Big data analysis with R and Apache Tajo (in Korean)Gruter
 
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중ymtech
 
AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017
AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017
AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017Amazon Web Services Korea
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache TajoGruter
 
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례Gruter
 
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arcNAVER D2
 
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1Seok-joon Yun
 
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Web Services Korea
 
하둡 타입과 포맷
하둡 타입과 포맷하둡 타입과 포맷
하둡 타입과 포맷진호 박
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxNeoClova
 

Similar to [pgday.Seoul 2022] PostgreSQL구조 - 윤성재 (20)

DBMS 아키텍처
DBMS 아키텍처DBMS 아키텍처
DBMS 아키텍처
 
Tajo and SQL-on-Hadoop in Tech Planet 2013
Tajo and SQL-on-Hadoop in Tech Planet 2013Tajo and SQL-on-Hadoop in Tech Planet 2013
Tajo and SQL-on-Hadoop in Tech Planet 2013
 
그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조그림으로 공부하는 오라클 구조
그림으로 공부하는 오라클 구조
 
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
[2015 07-06-윤석준] Oracle 성능 최적화 및 품질 고도화 4
 
AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)
AWS CLOUD 2018- Amazon Aurora  신규 서비스 알아보기 (최유정 솔루션즈 아키텍트)
 
Oracle History #7
Oracle History #7Oracle History #7
Oracle History #7
 
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
SQL-on-Hadoop with Apache Tajo,  and application case of SK TelecomSQL-on-Hadoop with Apache Tajo,  and application case of SK Telecom
SQL-on-Hadoop with Apache Tajo, and application case of SK Telecom
 
(120128) #fitalk sql server anti-forensics
(120128) #fitalk   sql server anti-forensics(120128) #fitalk   sql server anti-forensics
(120128) #fitalk sql server anti-forensics
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
 
Big data analysis with R and Apache Tajo (in Korean)
Big data analysis with R and Apache Tajo (in Korean)Big data analysis with R and Apache Tajo (in Korean)
Big data analysis with R and Apache Tajo (in Korean)
 
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
 
AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017
AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017
AWS를 통한 빅데이터 기반 비지니스 인텔리전스 구축- AWS Summit Seoul 2017
 
Introduction to Apache Tajo
Introduction to Apache TajoIntroduction to Apache Tajo
Introduction to Apache Tajo
 
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
GRUTER가 들려주는 Big Data Platform 구축 전략과 적용 사례: 인터넷 쇼핑몰의 실시간 분석 플랫폼 구축 사례
 
Kubernetes
Kubernetes Kubernetes
Kubernetes
 
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
3.[d2 오픈세미나]분산시스템 개발 및 교훈 n base arc
 
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
[2015-06-12] Oracle 성능 최적화 및 품질 고도화 1
 
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
 
하둡 타입과 포맷
하둡 타입과 포맷하둡 타입과 포맷
하둡 타입과 포맷
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
 

More from PgDay.Seoul

[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기PgDay.Seoul
 
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기PgDay.Seoul
 
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDWPgDay.Seoul
 
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개PgDay.Seoul
 
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposhaPgDay.Seoul
 
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPAPgDay.Seoul
 
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기PgDay.Seoul
 
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계PgDay.Seoul
 
[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgres[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgresPgDay.Seoul
 
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우PgDay.Seoul
 
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종PgDay.Seoul
 
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진PgDay.Seoul
 
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명PgDay.Seoul
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오PgDay.Seoul
 
PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PgDay.Seoul
 
pg_hba.conf 이야기
pg_hba.conf 이야기pg_hba.conf 이야기
pg_hba.conf 이야기PgDay.Seoul
 
Pg report 20161010_02
Pg report 20161010_02Pg report 20161010_02
Pg report 20161010_02PgDay.Seoul
 

More from PgDay.Seoul (17)

[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
 
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
 
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW
 
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
 
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
 
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
 
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
 
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
 
[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgres[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgres
 
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
 
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
 
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진
 
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
 
PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개PostgreSQL 9.6 새 기능 소개
PostgreSQL 9.6 새 기능 소개
 
pg_hba.conf 이야기
pg_hba.conf 이야기pg_hba.conf 이야기
pg_hba.conf 이야기
 
Pg report 20161010_02
Pg report 20161010_02Pg report 20161010_02
Pg report 20161010_02
 

[pgday.Seoul 2022] PostgreSQL구조 - 윤성재

  • 1. PostgreSQL Architecture 2022년 11월 12일 놀러가기 좋은 토요일 오후
  • 2. CONTENTS 01. 발표자 소개 02. PostgreSQL 구조 03. PostgreSQL Cluster 04. PostgreSQL - Process 05. PostgreSQL - Memory 06. PostgreSQL - File Layout
  • 4. 1. 발표자 소개 윤성재 (공작명왕, gongjak@gmail.com ) 리눅스 엔지니어, Service Administrator, Database 운영 Administrator Cloud Solutions Architecture (AWS / GCP) 1984년 Apple II 와 만남 1994년 Linux (Slackware)와 만남 1997년 070 서비스 개발자로 IT 업무 시작 2009년 DBA로 업무 시작 2013년 Cloud 세상에 첫걸음 (AWS/GCP) 2015년 PostgreSQL을 실제 서비스에 처음 적용해 봄 2016년 처음으로 책을 써 봄 2018년 Cassandra로 No SQL 운영 2020년 GCP Solutions Architect로 근무 중
  • 5. 1. 발표자 소개 발표자가 몸 담고 있는 곳 - CLOUDGRAM 소개
  • 6. 2. PostgreSQL 구조 PostgreSQL의 Client – Server 모델 Command : psql
  • 7. 3. PostgreSQL Cluster PostgreSQL Cluster Structure - PostgreSQL 공식 문서 : 각 Table은 rows의 모음이고, 각 rows는 columns 의 집합이고, 각 columns은 특정 데이터 유형입니다. Table은 databases 안에 존재하고, 이 databases의 모음을 하나의 PostgreSQL 서버가 관리 합니다. 이 하나의 서버가 관리하는 database 집합 단위를 Cluster 라 합니다. initdb -D /usr/local/pgsql/data
  • 8. 3. PostgreSQL Cluster Roles • Roles는 Users/Groups를 모두 포괄하는 개념 • PostgreSQL 8.1 이전 버전에서는 사용자와 그룹이 별개의 개체였지만 이후에 Role로 통합됨. • 유저 생성, 그룹 생성, 권한 부여 등이 모두 role 기반 • 설정 방법에 따라 사용자 또는 그룹으로 가능 • 모든 Role은 사용자, 그룹 또는 둘 다의 역할을 할 수 있습니다. • 처음 설치 시 기본으로 postgres 유저가 생성됨 du du+ SELECT * FROM pg_user;
  • 9. 3. PostgreSQL Cluster Databases • 처음 설치 시 postgres, templete0, templete1 3개의 database가 기본으로 생성됨 • PostgreSQL의 Database는 여러 schema로 구성 • Schemas는 Tables, Views, Sequences, Synonyms, Domains, Functions, Procedures 등과 같은 Object 들의 논리적인 집합 l l+ SELECT * FROM pg_database;
  • 10. 3. PostgreSQL Cluster Databases - schemas Server > PostgreSQL 14 (Cluster) > Databases > Schemas > Tables > Rows > Columns • Oracle Database는 User가 Schema 임 • MySQL은 Schema와 Database가 동일 • Role 을 이용하여 권한을 부여할 때 반드시 Database > Schema > Table의 순서로 부여해줘야 함 c {database_name} dn dn+ SELECT * FROM pg_user;
  • 11. 3. PostgreSQL Cluster Tablespaces • PostgreSQL에서의 Tablespace는 파일이 위치하는 경로 • Tablespace는 Oracle Database, PostgreSQL에서 사용되며, MySQL, MS-SQL에는 없는 개념 • PostgreSQL에서는 PGDATA라는 환경변수에 지정된 폴더 전체를 Database에서 사용하고 있으며, 테이블은 그 하위에 폴더와 파일로 생성 • Tablespace를 사용하여 관리자는 PostgreSQL의 디스크 레이아웃을 제어 • 설치 시 “pg_default”, “pg_global” 2개의 Tablespace가 기본으로 생성 db db+ SELECT * FROM pg_tablespace;
  • 12. 4. PostgreSQL - Process Basic Architecture 1. postgres(Daemon) process 2. Background(Utility) process 3. Backend process 4. Client process Client postgres (구.Postmaster) Backend Processes Shared Memory Shared Buffers WAL Buffers CLOG Buffers Temp Buffers Other Buffers Physical Files Background(Utility) Processes Writer Check pointer WAL Writer Archiver Process Logging Collector Stats Collector Autovacuum Launcher WAL Files Data Files Log Files Archive Files fork() 참조: https://dbsguru.com/postgresql-architecture-process/
  • 13. 4. PostgreSQL - Process Postgres (구. Postmaster) Process • PostgreSQL Cluster의 첫 번째 프로세스 • 하나의 Cluster에 대해 하나의 postgres(server process)가 존재 • postmaster는 버전 8.1.23까지 사용되었으며, 버전 8.2부터는 postgres로 실행 ps -ef| grep postgres pstree | grep post pstree {postgres의 PID} pstree -p {postgres의 PID}
  • 14. 4. PostgreSQL - Process Background (Utility) Processes • Logging Collector stderr로 전송된 로그 메시지를 캡처하고 로그 파일로 재전송 설정 파일의 logging_collector 매개변수로 설정하며, 기본값은 off. 적용을 위해 재시작 필요. • Stats Collector DBMS의 세션 정보, 테이블 통계 같은 정보를 수집 통계 정보는 운영중에 pg_stat_tmp 폴더의 파일에 저장하고, DB가 중지되면 pg_stat 폴더로 복사하고, DB가 시작되면 pg_stat 폴더에 있는 것을 pg_stat_tmp 폴더로 복사함. 15버전에서는 이 절차가 사라짐. • Autovacuum Launcher Vacuum 이 필요할 때 autovacuum worker를 fork 함 설정 파일의 매개변수 autovacuum 으로 설정하며, 기본값은 on. • WAL(Write-Ahead Logging) writer WAL Buffers의 내용을 WAL files에 기록 • Archiver Archiving 모드일 경우, 재활용할 WAL 파일을 archive_command에서 지정한 방식으로 처리함. 설정 파일의 매개변수 archive_mode 로 설정하며, 기본값은 off. 적용을 위해 재시작 필요.
  • 15. 4. PostgreSQL - Process Background (Utility) Processes background writer • 주기적으로 Shared Buffers의 Dirty Data page를 물리적인 data file에 기록 checkpointer • Checkpoint 발생시 Shared Buffers의 Dirty Data page을 data file에 기록 • 많은 I/O(Input/Output) 발생 가능 • 발생조건 ü checkpoint_timeout (300초) ü 트랜잭션 로그(WAL 파일, 1GB) 전체 크기가 max_wal_size 값을 초과 Client postgres (구.Postmaster) Backend Processes Shared Memory Shared Buffers WAL Buffers CLOG Buffers Temp Buffers Other Buffers Physical Files Background(Utility) Processes Writer Check pointer WAL Writer Archiver Process Logging Collector Stats Collector Autovacuum Launcher WAL Files Data Files Log Files Archive Files fork() 참조: https://dbsguru.com/postgresql-architecture-process/
  • 16. 4. PostgreSQL - Process Background (Utility) Processes WAL(Write-Ahead Logging) writer • WAL Buffers의 내용을 WAL files에 기록 Archiver • Archiving 모드일 경우, 재활용할 WAL 파일을 archive_command에서 지정한 방식으로 처리 • 설정 파일의 매개변수 archive_mode 로 설정 (기본값은 off. 적용시 재시작 필요) Client postgres (구.Postmaster) Backend Processes Shared Memory Shared Buffers WAL Buffers CLOG Buffers Temp Buffers Other Buffers Physical Files Background(Utility) Processes Writer Check pointer WAL Writer Archiver Process Logging Collector Stats Collector Autovacuum Launcher WAL Files Data Files Log Files Archive Files fork() 참조: https://dbsguru.com/postgresql-architecture-process/
  • 17. 4. PostgreSQL - Process Background (Utility) Processes Logging Collector • stderr로 전송된 로그 메시지를 캡처하고 로그 파일로 재전송 • 설정 파일의 logging_collector 로 설정 (기본값은 off. 변경시 재시작 필요) Stats Collector • DBMS의 세션 정보, 테이블 통계 같은 정보를 수집 • DB 운영 중: pg_stat_tmp 폴더의 파일에 저장 • DB가 중지 : pg_stat 폴더로 복사 • DB가 시작 : pg_stat 폴더에 있는 것을 pg_stat_tmp 폴더로 복사 • 15버전에서는 이 절차가 사라짐. Autovacuum Launcher • Vacuum 이 필요할 때 autovacuum worker를 fork 함 • 설정 파일의 매개변수 autovacuum 으로 설정하며, 기본값은 on. Client postgres (구.Postmaster) Backend Processes Shared Memory Shared Buffers WAL Buffers CLOG Buffers Temp Buffers Other Buffers Physical Files Background(Utility) Processes Writer Check pointer WAL Writer Archiver Process Logging Collector Stats Collector Autovacuum Launcher WAL Files Data Files Log Files Archive Files fork() 참조: https://dbsguru.com/postgresql-architecture-process/
  • 18. 4. PostgreSQL - Process Backend Process & Client Process Client Process • 사용자가 PostgreSQL에 접속하기 위해 사용하는 모든 응용프로그램 • 사용자의 OS 환경과 취향에 따라 여러 프로그램 • 대표 응용프로그램: psql 등 Backend Process • 모든 Backend 사용자 연결에 할당되는 Background process를 의미 • Client의 요청시 postgres main process(구. postmaster)에서 사용자 연결을 위해 postgres process를 분기(fork) • 사용자의 SQL과 Command 요청을 수행하여 결과를 전송 • 사용자 프로세스와 1:1 로 생성됨 • 매개변수 max_connections 의 값만큼 동시 연결이 가능하며, 기본값은 100. • 쿼리 실행에는 일부 메모리(Local Memory)가 필요함
  • 19. 5. PostgreSQL – Memory Memory Components of PostgreSQL Shared Memory Shared Buffers WAL Buffers CLOG Buffers Lock Space Other Buffers Per backend memory Maintanance_work_mem temp_Buffer work_mem catalog_cache Optimizer / executor OS Cache PostgreSQL 메모리 구성요소 2가지 Share Memory • 데이터베이스의 캐싱 및 트랜잭션 로그 캐싱을 위해 예약된 메모리 • 모든 프로세스가 공유하여 사용하는 공간 • 설정(config)의 매개변수 4개 영역 ü Shared Buffers ü WAL(Write-Ahead Logging) Buffers ü Clog(Commit log) Buffer ü Lock Space (Memory for Locks) Backend Memory (Process Memory) • Backend process가 요청 받은 Query를 실행하기 위한 메모리( = Local Memory ) • 설정(config)의 매개변수 ü work_mem(기본값 4MB) ü Maintenance_work_mem(기본값 64MB) ü temp_buffers(기본값 8MB)
  • 20. 6. PostgreSQL – File Layout 환경변수 PGDATA에 의해 저장됨 아이템 설명 PG_VERSION PostgreSQL 의 major 버전 번호가 포함된 파일 base 데이터베이스별 하위 디렉터리를 포함하는 하위 디렉터리 current_logfiles 로깅 수집기가 현재 기록한 로그 파일을 기록하는 파일 global pg_database와 같은 클러스터 전체 테이블을 포함하는 하위 디렉토리 pg_commit_ts 트랜잭션 커밋 타임스탬프 데이터가 포함된 하위 디렉터리 pg_dynshmem 동적 공유 메모리 하위 시스템에서 사용하는 파일을 포함하는 하위 디렉터리 pg_logical 논리적 디코딩을 위한 상태 데이터를 포함하는 하위 디렉토리 pg_multixact 다중 트랜잭션 상태 데이터를 포함하는 하위 디렉터리 (공유 행 잠금에 사용됨) pg_notify LISTEN/NOTIFY 상태 데이터를 포함하는 하위 디렉토리 pg_replslot 복제 슬롯 데이터를 포함하는 하위 디렉토리 pg_serial 커밋된 직렬화 가능한 트랜잭션에 대한 정보를 포함하는 하위 디렉토리 pg_snapshots 내보낸 스냅샷이 포함된 하위 디렉토리
  • 21. 6. PostgreSQL – File Layout 환경변수 PGDATA에 의해 저장됨 아이템 설명 pg_stat 통계 하위 시스템에 대한 영구 파일을 포함하는 하위 디렉터리 pg_stat_tmp 통계 하위 시스템에 대한 임시 파일을 포함하는 하위 디렉토리 pg_subtrans 하위 트랜잭션 상태 데이터를 포함하는 하위 디렉토리 pg_tblspc 테이블스페이스에 대한 심볼릭 링크를 포함하는 하위 디렉토리 pg_twophase 준비된 트랜잭션에 대한 상태 파일을 포함하는 하위 디렉토리 pg_wal WAL(Write Ahead Log) 파일을 포함하는 하위 디렉토리 pg_xact 트랜잭션 커밋 상태 데이터를 포함하는 하위 디렉터리 postgresql.auto.conf ALTER SYSTEM에서 설정한 구성 매개변수를 저장하는 데 사용되는 파일 postmaster.opts 서버가 마지막으로 시작된 명령줄 옵션을 기록하는 파일 postmaster.pid 현재 포스트마스터 프로세스 ID(PID), 클러스터 데이터 디렉토리 경로, 포스트마스터 시작 타임스탬프, 포트 번호, Unix 도메인 소켓 디렉토리 경로(비어 있을 수 있음), 첫 번째 유효한 listen_address(IP 주소 또는 *, 그렇지 않은 경우 비어 있음)를 기록하는 잠금 파일 TCP에서 수신 대기) 및 공유 메모리 세그먼트 ID(이 파일은 서버 종료 후 존재하지 않음)
  • 22. [참고] PostgreSQL 15: Stats Collector Gone? 이제 통계 수집기가 사라졌습니다. What? • 쿼리 플랜에 사용되는 table-level statistics collection(ANALYZE)와 혼동하는 기능 • 테이블이나 인덱스가 스캔한 횟수, 테이블에서 마지막 vacuum 또는 autovacuum이 실행된 횟수 등과 같은 누적 통계를 얻기 위해 각 프로세스의 모든 활동을 추적 • pg_stat_* 를 통해 확인 Wrong? • 세션의 Backend process는 수행한 활동을 UDP 소켓을 통해 전송 ü 오래된 통계 ü 통계 수집기가 실행되지 않음 ü autovacuum이 작동하지 않거나 시작하지 않음 • pg_stat_tmp 폴더에 대량의 IO가 발생할 수 있음 New • PostgreSQL 15에서 통계는 파일과 파일 시스템 대신 동적 공유 메모리를 사용 • 이제 통계 수집기는 제거 대상임 • 참조 : Andres Freund의 commit 내용 (https://git.postgresql.org/gitweb/?p=postgresql.git;h=5891c7a 8e) • 재 시작시 종료 직전에 체크포인터 프로세스에 의해 파일 시스템에 기록되고 시작 프로세스에 의해 시작하는 동안 다시 로드됨. • 충돌이 발생하면 통계가 삭제됨 Getting Better • 통계 수집기의 오버헤드와 유지관리가 사라지면서 autovacuum과 같은 하위 시스템의 할 일이 줄어듬 • 통계 정보를 자주 조회하는 모니터링 도구는 시스템 부하를 훨씬 덜 유발할 것으로 예상됨