COSCUP 2024

Unlock the Power of PostgreSQL: Building Query Optimization Extensions
2024-08-03, 10:45–11:15 (Asia/Taipei), TR514

PostgreSQL is a globally renowned open-source database, widely utilized across various industries. It was honored as the DBMS of the Year in 2023 by DB-Engines Ranking[1]. One of the key factors contributing to its popularity is its extensibility. Extensions allow users to add new features to PostgreSQL. Despite many users' desire to create extensions, a clear guide on where to start has been lacking. Last year, I gave a talk on taking the first steps towards developing extensions[2]. This year, I will present a more advanced lecture. Initially, I will explain how to develop a simple extension, followed by a detailed exploration of my developed extensions that provide features like "Automatic Query Execution Plan Tuning" and "Automatic Hint Clause Generation" through the extension pg_plan_advsr[3]. I will explain the hooks used, the mechanisms involved, their impacts, and provide demonstrations. The intended audience includes individuals interested in PostgreSQL, those eager to develop extensions, and anyone keen on query performance enhancement. My hope is that this talk will contribute to the growth of the PostgreSQL community. [1]: https://db-engines.com/en/blog_post/106 [2]: https://coscup.org/2023/en/session/V3YWCF [3]: https://github.com/ossc-db/pg_plan_advsr


PostgreSQL is a globally renowned open-source database, widely utilized across various industries. It was honored as the DBMS of the Year in 2023 by DB-Engines Ranking[1]. One of the key factors contributing to its popularity is its extensibility. Extensions allow users to add new features to PostgreSQL. Despite many users' desire to create extensions, a clear guide on where to start has been lacking. Last year, I gave a talk on taking the first steps towards developing extensions[2]. For example, I explained hook points and templates available when creating an extension.

This year, I will present a more advanced lecture. Initially, I will explain how to develop a simple extension, followed by a detailed exploration of my developed extensions that provide features like "Automatic Query Execution Plan Tuning" and "Automatic Hint Clause Generation" through the extension pg_plan_advsr[3]. I will explain the hooks used, the mechanisms involved, their impacts, and provide demonstrations.

This talk includes the following contents:
- Explanation of PostgreSQL
- Overview of extensions
- Introduction of a simple extension example
- Explanation of the mechanism and the merits of my extension pg_plan_advsr

The intended audience includes individuals interested in PostgreSQL, those eager to develop extensions, and anyone keen on query performance enhancement. I hope this talk will contribute to the growth of the PostgreSQL community.

Tatsuro Yamada is a PostgreSQL Support Team Leader for NTT Open Source Software Center. He continues contributing to the PostgreSQL community and is an Oracle_fdw committer, pg_plan_advsr author, and officially recognized PostgreSQL contributor. He has been a speaker for the promotion of the PostgreSQL community and was a speaker at Postgres Conference Japan 2014, PGCon 2016, PGConf.Eu 2018, PGConf.Asia 2019, among others. For PGConf.Asia, he contributed as one of the organizing members from 2017-2022.