PostgreSQL High Performance Tuning Guide

2h 41m 14s
English
Paid

Course description

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.

Read more about the course

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.

Watch Online

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

Watch Online PostgreSQL High Performance Tuning Guide

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

Comments

0 comments

Want to join the conversation?

Sign in to comment

Similar courses

Fundamentals of Networking Engineering

Fundamentals of Networking Engineering

Sources: udemy
We are entering an era in software engineering where we rely on libraries and frameworks to do most of our work. While this is useful and save tremendous dev ho
18 hours 6 minutes 23 seconds
Node, SQL, & PostgreSQL - Mastering Backend Web Development

Node, SQL, & PostgreSQL - Mastering Backend Web Development

Sources: udemy
Become an in demand software engineer by taking this course on Node, SQL, PostgreSQL, and backend web development. As one of the most popular web development st
4 hours 59 minutes 41 seconds
DuckDB - The Ultimate Guide

DuckDB - The Ultimate Guide

Sources: udemy
Why should you study DuckDB? DuckDB is one of the fastest-growing technologies, with the number of search queries increasing by 1200% over the past two years!
5 hours 56 minutes 13 seconds
Building Full-Stack Apps with AI

Building Full-Stack Apps with AI

Sources: Mckay Wrigley (takeoff)
The course "Building Full-Stack Apps with AI" teaches how to create comprehensive applications using artificial intelligence, suitable for both beginners and...
8 hours 3 minutes 16 seconds