일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- OS
- Oracle GoldenGate
- signal
- influxdb
- oracle
- rac
- mysql
- grafana
- PostgreSQL
- ASM
- db
- cmake
- install
- unix
- C
- Architecture
- Linux
- MySQL Architecture
- Make
- oracle architecture
- Today
- Total
목록DB/PostgreSQL_Guide (15)
Blog

Tuple INSERT, DELETE, UPDATETuple에 초점을 맞추기 위해 Page Header와 Line Pointer를 표시하지 않은 Tuple의 표현INSERTINSERT문을 통해 새 Tuple이 대상 Table의 Page에 직접 INSERTTuple INSERTtxid가 99인 Tx에 의해 Page에 Tuple이 INSERT된 상황 가정시 INSERT된 Tuple의 Header FieldTuple_1이 Tuple은 txid 99에 의해 INSERT되어 t_xmin=99이 Tuple이 DELETE, UPDATE되지 않아 t_xmax=0이 Tuple이 txid 99에 의해 INSERT된 첫번째 Tuple이라서 t_cid=0이 Tuple이 최신 Tuple이기 때문에 t_ctid=(0,1)(자신을..

Tuple StructureData Page의 Heap Tuple은 일반 Data Tuple과 TOAST Tuple로 분류됨Heap Tuple은 HeapTupleHeaderData 구조, NULL Bitmap 및 User Data로 구성Heap Tuple 중 일반 Data Tuplet_xmin: 이 Tuple을 삽입한 Tx의 txid를 보유t_xmax: 이 Tuple을 DELETE, UPDATE한 Tx의 txid 보유 DELETE, UPDATE되지 않은 경우 t_xmax = 0(INVALID)t_cid: 현재 Tx 내에서 이 Command가 실행되기 전 몇 개의 SQL Command가 실행된 수를 표시 0 에서부터 증가ex) BEGIN; INSERT; INSERT; INSERT; COMMIT; 시 cid..

txidTx이 시작될 때마다 Tx Manager는 txid라 하는 고유 식별자를 할당PostgreSQL의 txid는 unsigned int(4Byte)로 약 42억개 Tx이 시작된 후 내장 함수 txid_current()를 실행해 현재 txid 반환 가능BEGIN; BEGIN SELECT txid_current(); txid_current -------------- 100 (1 row)PostgreSQL의 세 가지 특수 txid0: 잘못된 txid1: Bootstrap txid, DB Cluster의 초기화에만 사용2: Frozen txidTxid는 서로 비교할 수 있음PostgreSQL의 txid실제 System에서는 PostgreSQL의 txid 공간이 부족해 순환형으로 사용이전의 약 21억개는 과거..
Query Processing 개요Query ProcessingPostgreSQL에서 Ver 9.6에 구현된 Parallel Query가 여러 Background Worker Process를 사용하나 Backend Process는 기본적으로 연결된 Client에서 실행되는 모든 Query를 처리함Parser: 일반 Text의 SQL문에서 Parse Tree(구문 분석 트리)를 생성Analyzer / Analyser: Parse Tree의 의미론적 분석을 수행하고 Query Tree를 생성Rewriter: Rule이 있는 경우 Rule System에 저장된 Rule을 사용해 Query Tree를 변환Planner: Query Tree에서 효율적으로 실행할 수 있는 Plan Tree를 생성Executor: ..

Memory Architecture PostreSQL의 Memory Architecture는 Local Memory 영역와 Shared Memory 영역으로 나뉨 Local Memory 영역: 각 Backend Process가 자체 사용을 위해 할당 Shared Memory 영역: PostgreSQL Server의 모든 Process에서 사용 PostgreSQL의 Memory Architecture Local Memory Area 각 Backend Process는 Query 처리를 위해 Local Memory 영역을 할당함 각 영역은 고정 / 가변 크기인 여러 하위 영역으로 나뉨 sub-area description reference work_mem Executor가 ORDER BY 및 DISTINCT작..