PostgreSQL Topic Archive

MySQL PostgreSQL Articles

InnoDB internals, replication, locking, query performance, and MySQL operations notes.

MySQL Invisible Indexes: Test the Drop Before You Drop
9 min read

Dropping an index is instant; rebuilding it under incident pressure takes hours. Field notes on using MySQL 8.0 invisible indexes as a safety net, plus the audit workflow that finds safe candidates.

MySQL Partitioning in Production: An Operational Guide
10 min read

Partitioning solves data-lifecycle problems, not performance problems. Field notes on verifying pruning, automating partition maintenance, living with the foreign-key restriction, and knowing when to say no.

The MySQL sys Schema as a Daily Driver: Five Views Worth Your Time
9 min read

The sys schema ships with every MySQL 8.x server and most teams never open it. These are the five views I actually use every day - statement_analysis, the index-hygiene pair, file I/O, and host_summary - with the caveats that keep them honest.

MySQL Semi-Sync Replication Pitfalls in Production
9 min read

Semi-synchronous replication promises that a commit is acknowledged by at least one replica before the client sees success. The fine print — silent fallback to async, wait points, and what an ack actually means — is where production incidents live.

Where MySQL Memory Actually Goes: A Diagnosis Field Guide
10 min read

MySQL memory is not just the buffer pool. This guide maps global versus per-session allocations, shows how to interrogate performance_schema memory instrumentation, and walks through a real OOM-kill postmortem workflow.

MySQL Binlog Row Image and Size: Controlling Binlog Growth
8 min read

Row-based binary logging is the right default, but it makes binlog volume a function of how many rows you touch. This covers FULL vs MINIMAL row images, partial JSON logging, expiry settings, and the big-UPDATE binlog explosion.

mydumper vs mysqldump for Large MySQL Databases
9 min read

Logical backups scale badly by default. Field notes on where mysqldump stops working, what mydumper and myloader change, and the honest boundary where physical backups win.

The XtraBackup and Binlog PITR Workflow I Actually Trust
10 min read

Percona XtraBackup plus binary logs is still the workhorse recovery story for self-managed MySQL. These are field notes on the full/incremental cadence, prepare ordering, and the restore rehearsal that catches bad backups.

The Silent Index Killer: MySQL Collation Mismatches in JOINs
9 min read

A JOIN between columns with different charsets or collations can quietly turn an index lookup into a full scan. Field notes on how the coercion rules work, the utf8mb3/utf8mb4 upgrade trap, and the queries that find every mismatched column.

MySQL Invisible Indexes: Test the Drop Before You Drop
9 min read

Dropping an index is instant; rebuilding it under incident pressure takes hours. Field notes on using MySQL 8.0 invisible indexes as a safety net, plus the audit workflow that finds safe candidates.

MySQL Partitioning in Production: An Operational Guide
10 min read

Partitioning solves data-lifecycle problems, not performance problems. Field notes on verifying pruning, automating partition maintenance, living with the foreign-key restriction, and knowing when to say no.

The MySQL sys Schema as a Daily Driver: Five Views Worth Your Time
9 min read

The sys schema ships with every MySQL 8.x server and most teams never open it. These are the five views I actually use every day - statement_analysis, the index-hygiene pair, file I/O, and host_summary - with the caveats that keep them honest.

MySQL Binlog Row Image and Size: Controlling Binlog Growth
8 min read

Row-based binary logging is the right default, but it makes binlog volume a function of how many rows you touch. This covers FULL vs MINIMAL row images, partial JSON logging, expiry settings, and the big-UPDATE binlog explosion.

MySQL Semi-Sync Replication Pitfalls in Production
9 min read

Semi-synchronous replication promises that a commit is acknowledged by at least one replica before the client sees success. The fine print — silent fallback to async, wait points, and what an ack actually means — is where production incidents live.

Reducing Gap-Lock Pain in MySQL REPEATABLE READ
8 min read

Gap locks make InnoDB transactions collide over rows that do not exist. These are the patterns I use to shrink the lock footprint under REPEATABLE READ, and when READ COMMITTED is the honest answer.

A Repeatable MySQL Deadlock Postmortem Workflow
8 min read

Deadlocks are not random noise; each one is a recorded collision with a cause. This is the repeatable workflow I use to capture, parse, and permanently fix InnoDB deadlocks.

MySQL ORDER BY LIMIT and the Wrong Index Problem
9 min read

The most repeatable plan regression in MySQL: add LIMIT to an ORDER BY query and the optimizer abandons your selective index for the ordering one. Why it happens, how to spot it, and the fixes that hold.

MySQL optimizer_switch Flags That Bite in Production
9 min read

optimizer_switch is where MySQL hides two decades of query-planner history, and a handful of its flags cause real production regressions. Field notes on the ones that bite and how to test them one at a time.

Reading MySQL EXPLAIN ANALYZE Without Fooling Yourself
9 min read

MySQL 8.0.18 gave us EXPLAIN ANALYZE, and most people read its output wrong. Here is how the per-loop numbers actually work, the misreads I keep seeing, and when the tree format tells the truth tabular EXPLAIN hides.

A Working MySQL Slow Query Log Digest Workflow
8 min read

The MySQL slow query log is still the best forensic record of a bad deploy, but only if you configure it deliberately and digest it into query families. This is the workflow I actually run.

InnoDB Doublewrite Buffer: What It Costs and What It Protects
9 min read

Doublewrite exists for one narrow disaster: a torn page that redo cannot repair. This is an honest look at how it works, what it really costs in I/O, how to measure that overhead yourself, and when disabling it is actually defensible.

MySQL Internal Temporary Tables: When Queries Quietly Spill to Disk
9 min read

GROUP BY, DISTINCT, derived tables, and window functions can all materialize internal temp tables, and when those overflow memory your query is suddenly doing disk I/O nobody planned. Here is how the TempTable engine works and how to find the offenders.

MySQL Redo Log Capacity, Checkpoint Age, and Sync Flush Stalls
10 min read

When checkpoint age catches up with redo capacity, InnoDB stops the world to flush, and your p99 pays for it. Here is how innodb_redo_log_capacity works in 8.0.30+, how to size it against write bursts, and how furious flushing looks in the metrics.

InnoDB History List Length: The Canary for MySQL Purge Lag
9 min read

One idle REPEATABLE READ session can pin millions of undo records and slowly melt a busy MySQL server. History list length is the canary; this is how to watch it, find the blocker, and keep undo growth under control.