inflearn logo

Practical PostgreSQL for Developers Who Have Only Used MySQL — Learn by Reproducing MVCC, VACUUM, Execution Plans, and Indexes Hands-On

If you’ve built services with MySQL, run the same SQL side by side on MySQL 8.4 and PostgreSQL 17 to verify 40 differences firsthand using executable examples—from UPDATEs that make tables four times larger, different default isolation levels, 40001 serialization errors, and locking without gap locks to tree-shaped execution plans and partial, GIN, and BRIN indexes.

1 learners are taking this course

Level Intermediate

Course period Unlimited

PostgreSQL
PostgreSQL
MySQL
MySQL
SQL
SQL
DBMS/RDBMS
DBMS/RDBMS
database
database
PostgreSQL
PostgreSQL
MySQL
MySQL
SQL
SQL
DBMS/RDBMS
DBMS/RDBMS
database
database

What you will gain after the course

  • Use a checklist to identify queries and DDL migrated from MySQL that behave differently in PostgreSQL (case-sensitive comparisons, numbering, UPSERTs, type conversions, time zones, and DDL transactions).

  • We explain why the table has grown using dead tuple counts and autovacuum logs, and find and terminate long-running transactions that are blocking cleanup.

  • Identify the isolation levels and locking behavior that produce different results from MySQL in the same scenario, and decide where to add 40001 retry logic.

  • Read EXPLAIN (ANALYZE, BUFFERS) as a tree and quantify the causes of stale statistics, join strategies, and Index Only Scan failures.

  • Choose the right option among partial, expression, INCLUDE, GIN, and BRIN indexes and partitioning, then create it safely in production with CONCURRENTLY.

Why does something that seems obvious in MySQL behave differently in PostgreSQL? Run the same SQL side by side on both engines and see for yourself.

If you’ve built a service with MySQL, run the same SQL side by side on MySQL 8.4 and PostgreSQL 17 to see 40 differences firsthand using the actual statements, including UPDATEs that make tables four times larger, different default isolation levels, 40001 serialization errors, locks without gap locks, execution plans read as trees, and partial, GIN, and BRIN indexes.

Most PostgreSQL courses stop at introducing syntax and features. This course starts with your MySQL experience and runs the same data and SQL on both engines to show, with actual execution output at every step, what happens differently. It focuses on engine behavior that can lead to production incidents, such as row versions and VACUUM, isolation levels and locks, execution plans, and indexes. It also shares the inspection procedures used by a team lead DBA who runs both engines at a major e-commerce company.

By the end of this course, you will be able to

  • I use a checklist to identify queries and DDL migrated from MySQL that behave differently in PostgreSQL (case sensitivity, numbering, UPSERT, type conversion, time zones, and DDL transactions).

  • Explain why the table grew using dead tuples and autovacuum records, and find and terminate long-running transactions that are preventing cleanup.

  • In the same scenario, understand the isolation levels and locking behavior that lead to different results from MySQL, and decide where to add 40001 retry logic.

  • Read EXPLAIN (ANALYZE, BUFFERS) as a tree and explain in numbers the causes of stale statistics, join strategies, and Index Only Scan failures.

  • Choose the right option among partial, expression, INCLUDE, GIN, and BRIN indexes, and partitioning, then create it safely in production using CONCURRENTLY.

Recommended for these people

  • Backend developers who have built services with MySQL (InnoDB) and are now working with PostgreSQL for a new project or after changing jobs.

  • Teams considering or carrying out a migration from MySQL to PostgreSQL

  • Those who have completed an introductory PostgreSQL course and want a deeper understanding of how the engine works

Curriculum (6 sections · 40 lessons · approximately 292 minutes)

  • Section 1. Same SQL, Different Results — The same UPDATE, a table four times larger, different from the moment you connect — Databases, schemas, and roles; numbers and types — IDENTITY instead of AUTO_INCREMENT, case sensitivity and empty strings — Same WHERE, different row counts; UPSERT and type conversion — SQL that breaks when migrated; NULL sorting, pagination, and time zones — DATETIME and timestamptz

  • Section 2. MVCC and VACUUM — Where rows accumulate differs — Where row versions live — inside the table instead of undo, dead tuples and table size, VACUUM and VACUUM FULL are different, long transactions block cleanup, reading autovacuum logs, HOT updates and fillfactor, indexes bloat too — REINDEX, watch transaction ID age

  • Section 3. Transactions and Locks — Same Isolation Level, Different Results — Default Isolation Levels Differ, Same REPEATABLE READ, Different Outcomes — 40001, No Gap Locks — SERIALIZABLE Instead, FOR UPDATE·NOWAIT·SKIP LOCKED, Application Locks — Advisory Locks, DDL Can Be Rolled Back Too — And the Lock Wait Queue, Three Timeout Safeguards, Reading Deadlock Messages

  • Section 4. Execution Plans—Read Them as Trees and Prove Them with Numbers — Reading EXPLAIN as a tree, EXPLAIN (ANALYZE, BUFFERS), stale statistics ruin plans, conditions involving multiple columns—extended statistics, join methods—Nested Loop·Hash·Merge, no clustered index—heap and Index Only Scan, the cost of COUNT and deep OFFSET, finding slow queries with pg_stat_statements

  • Section 5. Indexes and Partitions — Options MySQL Didn’t Have — Partial Indexes — Only the Rows You Need, Expression Indexes — lower(email), Composite Indexes and INCLUDE, GIN and JSONB, BRIN — Large Time-Ordered Logs, Declarative Partitioning and Partition Pruning, CREATE INDEX CONCURRENTLY

  • Section 6. When Migrating — One connection per process; wrap-up: a checklist for migrating from MySQL to PostgreSQL

Hands-on Environment

Using Docker, we’ll launch MySQL 8.4 and PostgreSQL 17 side by side and load the same virtual shopping mall data into both (10,000 customers, 1,000 products, and 200,000 orders). Each lesson’s content can be reproduced exactly with a single ./scenarios/sNN.sh. Every number, error message, and execution plan shown in the lessons comes from actually running these exercises.

Prerequisites

  • Experience working with tables, indexes, and transactions in MySQL

  • SQL Joins

  • A computer with Docker installed (at least 4 GB of memory recommended)

What This Course Does Not Cover

  • SQL Basics from the Beginning

  • Server administration such as replication, high availability, backups, and major upgrades.

  • Cloud-Managed Database Configuration

  • ORM Mapping

Introduction

The slide narration uses synthesized speech. All data is simulated for educational purposes, and the numbers may vary depending on the execution environment.

Recommended for
these people

Who is this course right for?

  • A backend developer who has built services with MySQL (InnoDB) and is now working with PostgreSQL as part of a new project or after changing jobs.

  • A team evaluating and working on a migration from MySQL to PostgreSQL

  • Those who have completed an introductory PostgreSQL course and want to understand the engine’s inner workings in depth.

Need to know before starting?

  • Experience working with tables, indexes, and transactions in MySQL

  • SQL join

  • A computer with Docker installed (at least 4 GB of memory is recommended)

Hello
This is dorian05202988

Career Verified

A data craftsman with over 20 years of experience in databases and IT. As a DBA and manager of a DB Platform team, I work with database platforms and specialize in MySQL, PostgreSQL, Oracle, MongoDB, SQL tuning, AWS, Terraform, and Python. Drawing on experience in the gaming, finance, and IT services industries, I explain database and cloud architecture. I have published 『Oracle Practical Tuning: Learning SQL Patterns』 and 『Oracle Pro*C Practical Project Guide』, and have presented on serverless architectures, database selection, and multi-database strategies at AWS Summit 2018 and 2019 and DataYa Nolja 2020. Recently, I have been working on slow-query analysis and tuning recommendations using Bedrock LLM, automated DB specification sizing, and query workflows through a DB metadata MCP server and Slack bot. I explain database automation for developers and AI applications for non-developers through hands-on exercises tailored to the audience and objectives of each course. Rather than applying AI suggestions as-is, I teach a decision-making framework that verifies result equivalence, execution plans, and observability conditions, and defers action when the supporting evidence is insufficient. Company operational data and credentials are not included in the course materials.

More

Curriculum

All

40 lectures ∙ (4hr 52min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

dorian05202988's other courses

Check out other courses by the instructor!

Similar courses

Explore other courses in the same field!

Limited time deal

$44.00

20%

$55.00