PostgreSQL Conference Japan 2018
[B3] Let's scale-out PostgreSQL using Citus
https://www.postgresql.jp/jpug-pgcon2018
Japanese Version
29回勉強会資料「PostgreSQLのリカバリ超入門」
See also http://www.interdb.jp/pgsql (Coming soon!)
初心者向け。PostgreSQLのWAL、CHECKPOINT、 オンラインバックアップの仕組み解説。
これを見たら、次は→ http://www.slideshare.net/satock/29shikumi-backup
PostgreSQL 14 Beta 1 New Features with Examples (English)Noriyoshi Shinoda
This document provides an overview of the major new features in PostgreSQL 14 Beta 1. Some key points include:
- Performance improvements through enhancements to logical replication, parallel queries, LZ4 compression, and BRIN indexes.
- Reliability improvements such as more robust data structure checking and removing password length restrictions.
- Improved maintainability through features like enhanced REINDEX and new monitoring capabilities.
- Preparation for future features like data access by subscripts and changes to functions and operators to support this.
- Incompatibilities include changes to functions, regular expressions, and transaction ID wraparound thresholds.
PostgreSQL 12 New Features with Examples (English) GANoriyoshi Shinoda
This document provides an overview of new features in PostgreSQL 12, including improvements to analytic query performance, reliability, and maintainability. It also discusses changes that may cause incompatibility with previous versions. The document is intended for PostgreSQL users and provides detailed information on changes to architecture, SQL statements, configuration parameters, utilities, and contrib modules in PostgreSQL 12.
PostgreSQL 12 Beta 1 New Features with Examples (English)Noriyoshi Shinoda
The document summarizes new features in PostgreSQL 12 Beta 1. Major changes include improvements to analytic query performance through enhancements to parallel queries and partition tables, increased reliability with expanded integrity checking tools, and improved maintainability through changes like abolishing the recovery.conf file and adding monitoring features. The document also notes some incompatible changes in PostgreSQL 12.
The document presents an overview of Citus, an extension for PostgreSQL that enables scaling out by distributing data across multiple nodes. It includes installation procedures, architecture details, and operational behavior while addressing potential issues and restrictions in SQL execution. Notably, it emphasizes the importance of implementing fault tolerance and backup strategies by users, as automatic features are not provided in the community edition.
This document provides an overview and details of new features in PostgreSQL 11. It introduces enhancements to parallel queries, partitioned tables, logical replication, architecture changes, new SQL statements and functions, changes to PL/pgSQL, configuration parameters, and utilities. Major new features include improved performance for analytic queries, maintenance tasks, and reliability.
PostgreSQL 11 New Features English version (Beta 1)Noriyoshi Shinoda
PostgreSQL 11 includes enhancements that allow parallel execution for more query types including hash joins, appends, CREATE TABLE AS SELECT statements, and CREATE MATERIALIZED VIEW statements. It also includes improvements to partitioned tables, logical replication, and maintenance features to improve performance, manageability and reliability compared to PostgreSQL 10. Some changes in PostgreSQL 11 can cause incompatibilities with applications, and functions like TO_NUMBER now behave differently than in previous versions.
The document discusses logical replication in PostgreSQL, detailing its architecture, functionality, and restrictions. It covers the processes of creating publications and subscriptions for data replication, outlining necessary configurations like WAL settings and the limitations regarding certain SQL operations and objects. Troubleshooting sections address potential issues during replication, including conflicts and resource shortages, along with their resolutions.
This document provides an overview of new features in PostgreSQL 10, including native partition tables, logical replication, enhancements to parallel query, monitoring, row level security, SQL statements, and configuration parameters. It discusses features such as partition tables that can improve performance for large datasets, logical replication for reliability, and monitoring changes like the EXPLAIN SUMMARY statement. The document is intended for PostgreSQL users and provides details on the new features and their usage.
PostgreSQL Internals (1) for PostgreSQL 9.6 (English)Noriyoshi Shinoda
This document provides an overview of PostgreSQL internals including its process and memory architecture, storage architecture, and file formats. It discusses topics like processes and signals, shared buffers, huge pages, checkpoints, WAL logs, the database directory structure, tablespaces, visibility maps, VACUUM behavior, online backups, and key configuration files. The document is intended for engineers using PostgreSQL and aims to help them better understand its internal workings.
4. Huge Pages
Huge Pages とは?
– Linux における複数サイズのメモリー・ページを管理する仕組み
– 通常 4KB のページで管理する領域以外に 2MB ページ(デフォルト)の領域を追加
– Huge Pages を意識させない Transparent Huge Pages 機能もあるが DBMS サーバには非推奨
– カーネル・パラメーター vm.nr_hugepages にページ数を指定(デフォルト 0)
– 参考:
– Huge Page とは何ですか? これを使用する利点は?
–https://access.redhat.com/ja/solutions/293173
– Tuning Red Hat Enterprise Linux Family for PostgreSQL
–https://www.enterprisedb.com/blog/tuning-red-hat-enterprise-linux-family-postgresql
3
5. Huge Pages
MySQL では?
– 設定
– PostgreSQL の huge_pages = try に近い動作
[System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.24) starting as process 116322
[System] [MY-013576] [InnoDB] InnoDB initialization has started.
[Warning] [MY-012677] [InnoDB] Failed to allocate 138412032 bytes. errno 1
[Warning] [MY-012679] [InnoDB] Using conventional memory pool
[System] [MY-013577] [InnoDB] InnoDB initialization has ended.
# cat /etc/my.cnf
[mysqld]
large-pages
– 起動ログ
– Huge Pages 領域が確保できないので通常メモリーを使用するログが出力される
4
6. Huge Pages
Oracle Database では?
– 設定
– PostgreSQL の huge_pages = try に近い動作
Supported system pagesize(s):
PAGESIZE AVAILABLE_PAGES EXPECTED_PAGES ALLOCATED_PAGES ERROR(s)
4K Configured 4 309127 NONE
2048K 600 1200 597 NONE
RECOMMENDATION:
1. For optimal performance, configure system with expected number of pages for every supported system
pagesize prior to the next instance restart operation.
SQL> SHOW PARAMETER use_large_pages
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
use_large_pages string TRUE
– 起動ログ
– Huge Pages 領域が確保できない場合は、確保できる部分のみ Huge Pages を使用するとログが出力される
5
12. コマンド・パラメーター
数値型のパラメーターに文字列を指定
– ソースコード
11
case 'Z': /* Compression Level */
compressLevel = atoi(optarg);
if (compressLevel < 0 || compressLevel > 9)
{
pg_log_error("compression level must be in range 0..9");
…
– PostgreSQL 15dev では改善
– 2021/7/24: Unify parsing logic for command-line integer options / Commit Hash: b859d94c で修正
case 'Z': /* Compression Level */
if (!option_parse_int(optarg, "-Z/--compress", 0, 9,
&compressLevel))
exit_nicely(1);
…
13. UNLOGGED TABLE
クラッシュ・リカバリ中のデータ削除
– マニュアル(CREATE TABLE)
12
クラッシュまたは異常停止の後、ログを取らないテーブルは自動的に切り詰められます。
– クラッシュ・リカバリ中のログ
LOG: listening on IPv4 address "127.0.0.1", port 5432
LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
LOG: database system was interrupted; last known up at 2021-08-23 12:54:55 JST
LOG: database system was not properly shut down; automatic recovery in progress
LOG: redo starts at 0/96F8E68
invalid record length at 0/FB7E220: wanted 24, got 0
LOG: redo done at 0/FB7E1B8 system usage: CPU: user: 0.21 s, system: 0.04 s, elapsed: 0.25 s
LOG: database system is ready to accept connections
– 「log_min_messages = DEBUG1」設定時のログ
DEBUG: resetting unlogged relations: cleanup 0 init 1
14. 予告
篠田の虎の巻
– Citus 10 の検証資料を作成中
– Columnar Table
– Shard Rebalancer
– Etc.
– Azure Database for PostgreSQL – Hyperscale (Citus) now GA
– https://azure.microsoft.com/en-us/updates/azure-database-for-postgresql-hyperscale-citus-columnar-
compression-now-generally-available/
– 9月前半には公開予定
13