Skip to main content
CF

PostgreSQL High Performance Tuning Guide

2h 41m 14s
English
Paid

PostgreSQL is one of the most powerful and convenient database management systems. It is actively supported by the community and receives new releases every year.

PostgreSQL supports the most advanced features of the SQL standard, as well as providing NoSQL capabilities, a rich set of data types, and extensions. All of this makes PostgreSQL an attractive solution for software systems.

However, extracting maximum performance from PostgreSQL is not an easy task. It requires a combination of proven techniques, thorough testing, reliable monitoring, and regular maintenance. It is also important to use additional tools that complement the capabilities of the main database.

This course provides you with both theoretical and practical knowledge to create high-performance solutions based on PostgreSQL. You will learn how to build dynamic databases for enterprise applications using the latest versions of PostgreSQL.

In the course, we will thoroughly examine advanced aspects of PostgreSQL such as logical replication, database clusters, performance tuning, and monitoring. You will learn how to work with the PostgreSQL optimizer, configure it for high speed, manage transactions, locks, indexes, and optimize queries.

The course assumes basic knowledge about databases, such as tables and indexes. This course will be useful both for newcomers to PostgreSQL and for those who have been working with it for several years. Even experienced PostgreSQL users will discover several new commands and optimization approaches, as well as gain a better understanding of how the database works.

Course on PostgreSQL Performance Tuning: Program

Learning PostgreSQL Server Architecture

In this section, we will explore the architecture of PostgreSQL. We will understand how the collaboration of Shared Buffers and the operating system cache improves performance by reducing the amount of physical input/output. We will also discuss the importance of configuring Checkpoints to minimize recovery time after failures and the necessity of the WAL Writer and Background Writer processes for efficient system functioning. We will learn about the stages the query processor goes through to achieve results and about the subsystems that ensure database maintenance.

Configuring VACUUM for Performance Improvement

We will look into why each UPDATE or DELETE operation leaves behind "dead" rows and indexes that require subsequent cleaning. We will learn how excessive accumulation of such rows degrades performance and why it is better to run the VACUUM process on a regular basis using autovacuum, rather than performing clean-up manually periodically.

Effective Use of Indexes

We will understand how indexes affect the load during the addition or modification of rows and why it's necessary to selectively add indexes. We will examine why an index is used only for selecting a small portion of rows and how data cardinality affects the choice of the optimal query execution plan.

Index Optimization Tips

We will learn how to configure indexes to speed up queries. We will consider covering indexes that allow responding to queries using only index data and learn about the benefits of indexing foreign keys. We will also discuss partial indexes and index combinations for performance enhancement.

Using Statistics

We will study PostgreSQL statistics that help identify and sort queries causing the highest load. We will learn how to find missing indexes and determine when they should be removed.

Identifying Query Problems

We will learn to read query plans and understand how each type of node contributes to the query execution. We will look at ways to identify the most resource-intensive parts of queries and methods for optimizing them.

Query Optimization Tips

We will learn why the correct semantics of a query are important before optimization and when it is better to avoid SELECT *, ORDER BY, and DISTINCT. We will study PostgreSQL functions, such as CASE syntax and parallel queries, to reduce execution time.

Configuring shared_buffers for Performance Improvement

We will learn how to optimally configure the shared_buffers parameter, considering low default values and the need for correlation with the operating system cache size.

Scaling and Replication

We will explore how replication helps distribute the load across multiple servers, enhancing system performance. We will study third-party solutions, such as Pgpool-II and Postgres-XL, which provide load balancing and scalability for large data volumes.

This course provides you with all the necessary knowledge for tuning PostgreSQL for high performance and helps you apply them to create reliable and scalable solutions in real projects.

About the Author: Udemy

Udemy thumbnail

Udemy is the largest open marketplace for online courses on the internet. Founded in 2010 by Eren Bali, Oktay Caglar, and Gagan Biyani and headquartered in San Francisco, the company went public on the Nasdaq in 2021 under the ticker UDMY. The platform hosts well over two hundred thousand courses across software development, IT and cloud, data science, design, business, marketing, and creative skills, taught by tens of thousands of independent instructors. Roughly seventy million learners use it worldwide, and the corporate arm — Udemy Business — supplies a curated subset of that catalog to enterprise customers.

Because Udemy is a marketplace rather than a single editorial publisher, the catalog is uneven by design. The strongest material lives in the long-form, project-based courses authored by working engineers — full-stack JavaScript, React, Node.js, Python data science, AWS, Docker and Kubernetes, mobile development with Flutter and React Native, and cloud certification preparation. The CourseFlix listing under this source is the slice of that catalog that has been mirrored here for offline-friendly viewing, organized by topic and updated as new releases land. Pricing on Udemy itself swings dramatically with the site's near-permanent sales, which is why the platform is best treated as a deep reference catalog: pick instructors with strong reviews and a track record of updating their material rather than buying on the headline price alone.

Watch Online 49 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 49 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Client-Server Architecture
All Course Lessons (49)
#Lesson TitleDurationAccess
1
Client-Server Architecture Demo
01:57
2
Understanding the Shared Buffer
03:08
3
The Path of the Query
01:41
4
Checkpoint
07:23
5
Postgres background writers
04:27
6
Utility Processes
02:08
7
Understanding Vacuum
01:52
8
Watching Vacuum at work
03:55
9
Finding bloated tables
01:31
10
Fighting table bloat
04:13
11
Common Vacuum problems
03:21
12
Making Use of Indexes
05:58
13
Using indexes in an intelligent way
04:25
14
Bitmap Scans
04:55
15
Making use of Index-Only scans and Covering Indexes
02:57
16
Indexing Foreign Keys
06:01
17
Partial Indexes
03:47
18
Clustered Tables
05:47
19
Cluster Command
01:25
20
Fill Factor
01:11
21
Combined vs Independent Indexes
01:53
22
Taking advantage of pg_stat_statements
07:08
23
Top 10 Time-Consuming Queries
01:16
24
Inspecting Table Statistics
02:24
25
Detect Missing Indexes
01:10
26
Hot Updates
02:03
27
Finding Useless Indexes
01:19
28
Understanding Execution Plans
06:53
29
Making EXPLAIN more verbose
01:07
30
Basic Cost Computation
02:37
31
Spotting Query Problems
03:47
32
Doing Joins Right
03:03
33
Forcing Join Order
05:53
34
Avoid Using SELECT *
02:17
35
Avoid ORDER BY
02:33
36
Avoid DISTINCT
00:37
37
Reducing the Number of SQL Statements
02:18
38
Parallel Queries
04:23
39
PostgreSQL Memory System
03:00
40
Analyzing PostgreSQL shared_buffers contents
07:55
41
PostgreSQL Scalability
02:22
42
Vertical vs Horizontal Scalability
02:20
43
Master-slave(s) with read/write separation
04:22
44
Physical Replication
01:01
45
Log Shipping
03:11
46
Streaming Replication
02:36
47
Logical Replication
03:23
48
Multi-Master Full Replication
02:13
49
Sharding
04:08
Unlock unlimited learning

Get instant access to all 48 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

Frequently asked questions

What prerequisites are needed before taking this course?
The course assumes a basic knowledge of databases, particularly concepts such as tables and indexes. It is designed for both newcomers to PostgreSQL and those with several years of experience. Familiarity with general database management principles will help you understand the more advanced topics covered in the course.
What projects or exercises will I work on during the course?
Throughout the course, you will engage in practical exercises such as configuring the PostgreSQL optimizer for high speed, managing transactions and locks, optimizing queries, and using tools like EXPLAIN to inspect execution plans. By the end, you should be able to build dynamic databases for enterprise applications using PostgreSQL's latest versions.
Who is the target audience for this course?
This course is aimed at database administrators, developers, and IT professionals interested in enhancing their PostgreSQL performance tuning skills. It is suitable for both newcomers and experienced PostgreSQL users looking to learn advanced commands and techniques for optimizing the database system.
How does this course compare in depth and scope to other PostgreSQL courses?
This course provides both theoretical and practical knowledge focused on high-performance solutions using PostgreSQL. It covers advanced topics such as logical replication, database clusters, performance tuning, and query optimization. Unlike some introductory courses, it includes detailed lessons on specific tools and methods like pg_stat_statements and EXPLAIN, offering a deeper exploration of performance tuning.
What specific tools or platforms will I learn to use?
The course will teach you to use tools like pg_stat_statements for identifying time-consuming queries, EXPLAIN for making execution plans more verbose, and VACUUM for database maintenance. You'll also learn about PostgreSQL's optimizer configurations, index management, and replication techniques such as log shipping and streaming replication.
What topics are specifically not covered in this course?
The course does not cover basic database concepts extensively, as it assumes foundational knowledge in these areas. It also does not focus on NoSQL capabilities or extensions beyond their role in performance tuning. The primary focus is on extracting maximum performance from PostgreSQL through advanced techniques and tools.
How much time should I expect to commit to this course?
The course consists of 49 lessons. While the total runtime is not specified, prospective students should anticipate dedicating a significant amount of time to both the theoretical and practical components, especially given the advanced nature of the topics. Regular practice and testing are encouraged to fully grasp the performance tuning techniques discussed.