Why MySQL 9 Feels Slow

MySQL used to be the fast one. Back in the 5.7 days, if you ran a typical website-style workload, MySQL would out-run heavier, fancier databases. Speed was its whole reputation. According to our benchmark numbers, that reputation no longer matches reality.

What We Built, and How We Tested It

We make PagibleAI CMS - a hybrid content management system used for headless or template-based setups built as Laravel package, designed to be fastest. It runs on five databases: MariaDB, MySQL, PostgreSQL, SQLite, and SQL Server - and we tune our queries and indexes for all five, not just one.

To keep ourselves honest, we run a benchmark suite that uses 10,000 pages nested three levels deep, with shared content blocks and files; runs every operation the CMS actually performs; and sends the exact same commands to every database. So when one database is slower, it is the database - not different code.

One detail matters. Our page tree is stored as a nested set: the whole tree is kept as numbered ranges, which makes reading a branch lightning-fast but makes moving or inserting a page shuffle the numbers on thousands of rows. Reads are cheap; some writes are expensive by design. And a CMS spends most of its time reading.

Problem #1: MySQL Is Slow at the Reads We Do Most

This is the part that should worry you, because reading is the bulk of the work.

Operation

MariaDB

MySQL

Factor

Load a page branch

20 ms

145 ms

7× slower

Fetch one content block

20 ms

113 ms

6× slower

Fetch one file

9 ms

64 ms

7× slower

Build the sitemap

136 ms

220 ms

1.6× slower

List pages (JSON API)

98 ms

138 ms

1.4× slower

These aren't exotic operations. Fetching one file, loading one content block, opening a branch of the page tree — this is what a CMS does all day, every day. MySQL takes 6–7× longer than MariaDB to do them, running the identical query.

Problem #2: It Is Even Worse Than It Looks

Each operation is partly database work and partly application work (PHP building the response). The application part is identical everywhere, so let's strip it away and look at only the database's share of the time:

DB query only

MariaDB

MySQL

Load a page branch

~1.5 ms

~124 ms

Build the sitemap

~13 ms

~99 ms

Fetch one content block

~0.7 ms

~97 ms

List pages (JSON API)

~1.6 ms

~12 ms

Measured on the database alone, MariaDB answers in one or two milliseconds while MySQL takes tens to over a hundred - often 50-130x slower on the same read.

Problem #3: MySQL Cannot Even Use Its Own Shortcuts

We store some data as JSON and add shortcut columns - pre-computed, indexed values so common lookups (a page's theme, type, or cache setting) are instant. Every database supports this. Here is a simple one-row lookup:

Lookup

MariaDB

SQL Server

PostgreSQL

MySQL

Page theme

1.6 ms

3.5 ms

15 ms

55 ms

Page type

1.3 ms

3.9 ms

18 ms

65 ms

Page cache

1.3 ms

5.2 ms

30 ms

55 ms

A single-row lookup. MariaDB: about 1 millisecond. MySQL: 55-65 - roughly 40-50x slower, because it ignores the shortcut and reads everything the long way.

We even caught it being indecisive: on one fetch, MySQL's database time bounced between 0.3 ms and 100 ms on the very same query - sometimes taking the shortcut, sometimes not. MariaDB took it every time. A database that flips a coin on how to run your query is not one you want under load.

Problem #4: The Expensive Writes Are Even More Expensive

Now the write side - moving and deleting pages, which the nested-set design makes heavy everywhere:

Operation

MariaDB

MySQL

Move a page

147 ms

307 ms

Purge a page

147 ms

369 ms

Delete a page

45 ms

67 ms

MySQL takes 2 to 2.5x longer. And it is not a fluke - the same gap shows up in a completely separate part of the suite (move: 160 vs 377 ms; remove: 141 vs 383 ms). When a result reproduces independently, it is real. One more sting: on several of these, even PostgreSQL beats MySQL - the database people pick for correctness, not speed.

So Why Is MySQL Like This?

Straight talk: the benchmarks prove MySQL is slow; they do not, by themselves, prove why. These are our best explanations, not measurements:

  • The optimizer keeps choosing the slow path. It repeatedly picks scan-everything over use-the-index, especially with shortcut columns. MariaDB makes the right call on the identical query. (One EXPLAIN command would confirm it.)
  • More overhead per operation. Newer MySQL carries heavier internal machinery on every statement. Widely reproduced by others, though we did not isolate it here.
  • Heavier write bookkeeping. Big tree-shuffling updates generate more internal logging on MySQL than on MariaDB.

What we can say with zero hedging: MariaDB and MySQL run the identical commands, and MariaDB is routinely 2x to 7x faster - over 50x faster on some reads.

In Fairness: Where MySQL Still Wins

We are ranting, not lying. MySQL genuinely beats MariaDB in two places:

  • Full-text search. Across eight different search queries, MySQL won every one - but the wins are sub-millisecond, too small to feel.
  • Simple single-row operations. Saving or fetching one record by its ID? MySQL is right there, sometimes a touch faster.

So the fair complaint is not "MySQL is slow at everything." It is sharper: MySQL falls apart on exactly the things a real CMS does most - list pages, load branches, fetch content, move pages - while staying fine on the trivial stuff.

The Bottom Line

What the numbers prove:

  • MariaDB beats MySQL on nearly everything that matters - 2-7x on real operations, 40-50x on indexed lookups.
  • PostgreSQL is often faster than MySQL too.
  • MySQL's only real win, full-text search, is too small to notice.

Our opinion: it looks like MySQL simply is not being tuned for performance anymore. The database that won the web on speed is coasting, while the fork it spawned kept pushing.

MySQL 5.7 earned its reputation. MySQL 9 is living off it.

If you want to see the raw numbers, have a look at our PagibleAI CMS performance tests

Run It on MariaDB

Building a fast, read-heavy website? PagibleAI CMS runs on MariaDB, MySQL, PostgreSQL, SQLite, and SQL Server - and it is tuned for all of them.