전체 글
-
PostgreSQL FDW(Foreign Data Wrapper)카테고리 없음 2019. 11. 22. 15:45
Foreign Data Wrappers In 2003, a new specification called SQL/MED ("SQL Management of External Data") was added to the SQL standard. It is a standardized way of handling access to remote objects from SQL databases. In 2011, PostgreSQL 9.1 was released with read-only support of this standard, and in 2013 write support was added with PostgreSQL 9.3. There are now a variety of Foreign Data Wrappers..
-
PostgreSQL Security카테고리 없음 2019. 11. 22. 15:37
보안에 있어서 Client Authentication과 Database Role, Data 암호화는 중요한 역할을 한다. 1. Client Authentication 참고 : https://www.postgresql.org/docs/10/auth-methods.html 2. Role 부여 및 Public에 대한 Role 회수 3. Data 암호화 암호화 관련 함수를 사용하기 위해 pgcrypto 암호화 모듈을 설치한다. CREATE EXTENSION pgcrypto; pgcrypto 모듈의 function 중 Password Hashing Functions, Raw Encryption Functions 에 대한 설명이다. 1) Password Hashing Functions crypt() 및 gen_sa..
-
PostgreSQL System Catalog카테고리 없음 2019. 11. 22. 15:33
효율적인 데이터베이스 관리를 위해 내부적인 catalog를 사용한다. catalog는 다른 RDBMS에서 data dictionary로 불리기도 한다. system catalogs list Catalog Name Purpose ag_graph graph information ag_label label information pg_aggregate aggregate functions pg_am index access methods pg_amop access method operators pg_amproc access method support procedures pg_attrdef column default values pg_attribute table columns (“attributes”) pg_auth..
-
PostgreSQL Server configurationPostgreSQL 2019. 11. 22. 15:26
1. parameter names and values 모든 매개변수 이름은 대소문자를 구분하며, boolean, string, integer, floating point 또는 enumerated(enum)의 5가지 타입 중 하나이다. 2. Parameter Interaction via Comfiguration File 매개변수를 설정하는 가장 기본적인 방법은 일반적으로 데이터 디렉터리에 있는 postgresql.conf 파일을 편집하는 것이다. 데이터베이스 클러스터 디렉터리가 초기화된 경우 기본 사본이 설치된다. 이 파일과 유사한 예시는 다음과 같다. # Connection Settings listen_addresses = 'localhost' port = 5432 max_connections = 100..
-
PostgreSQL Schema & Objects카테고리 없음 2019. 11. 22. 15:18
Schema는 Objects의 논리적인 집합으로 PostgreSQL은 여러 개의 Schemas로 구성되어 있다. Schema는 table, view, sequence, function등의 Objects로 구성되어 있다. Schema를 사용하는 이유 - 여러 사용자가 서로 간섭하지 않고 하나의 데이터베이스를 사용할 수 있게 한다. - 데이터베이스 개체를 논리적 그룹으로 구성하여 관리하기 쉽게 만든다. - 타사 응용 프로그램을 별도의 Schema에 넣을 수 있으므로 다른 개체의 이름과 충돌하지 않는다. PostgreSQL은 여러 데이터베이스를 생성할 수 있으며, 각 데이터베이스는 하나 이상의 schema를 가진다. PostgreSQL은 기본 스키마 ‘public’과 특수 스키마인 ‘pg_catalog’가 있..
-
PostgreSQL 성능 관련 옵션PostgreSQL 2019. 11. 22. 15:15
autovacuum_max_workers CPU의 코어수가 많은 경우 사용가능 기본값은 0 동시에 작업을 수행 할 수 있도록 코어 수와 동일한 값으로 설정하면 좋음 해당 매개 변수와 함께 multiple_autovacuum_workers를 설정해야 함 이 값은 코어의 1/2보다 큰 값으로 설정 autovacuum_vacuum_scale_factor Vacuuming은 삭제 및 삽입으로 생성된 dead tuples를 제거하는 프로세스 지정된 임계 값에 따라 테이블을 자동으로 vacuuming 함 effective_cache_size 캐시할 수 있는 메모리 양이 증가 값이 클수록 데이터베이스에서 index를 더 많이 사용함 권장값은 RAM 값의 50% 이상 maintenance_work_mem vacuumi..
-
PostgreSQL 동시성 제어카테고리 없음 2019. 11. 22. 15:14
PostgreSQL은 동시성 제어에 대해 관계형 데이터를 처리할 수 있다. 동시성 제어는 SQL 동작 방식을 이해해야 한다. 동시성 제어는 PostgreSQL의 공식 문서인 https://www.postgresql.org/docs/current/static/mvcc.html에서 더 자세한 정보를 얻을 수 있다. 동시성 제어 다중버전동시제어(MultiVersion Concurrency Control: MVCC) 1999년 Vadim이 PostgreSQL 6.5부터 MVCC 아키텍처를 도입했다. 트랜잭션(Transaction) 트랜잭션은 앞뒤에 BEGIN 및 COMMIT 명령을 사용한 SQL 명령으로 설정된다. COMMIT 대신 ROLLBACK를 사용하면 지금까지 수행한 SQL 명령이 취소된다. 모든 SQL..
-
PostgreSQL 동시성 개요PostgreSQL 2019. 11. 22. 15:08
이 문서에서는 PostgreSQL의 동시성(Concurrency) 항목에 대해 설명한다. PostgreSQL의 Concurrency에 대해 설명한 자료가 있는지 확인한다. PostgreSQL 공식 문서는 있다. PostgreSQL 공식 문서를 바탕으로 Concurrency에 대해 설명한다. PostgreSQL 공식 문서에서 Concurrency는 다중버전동시제어(Multi Version Concurrency Control: MVCC), 트랜잭션 격리(Transaction Isolation), 명시적 잠금(Explicit Locking), 데드락(Deadlock), Application의 Data Consistency, Index에 대한 주제로 설명되어 있다. 먼저, PostgreSQL에 대해 설명한다. ..