Recent Articles - MySQL

Calculating Table Size in MySQL
Calculating Table Size in MySQL
Sep 15, 2022 · 2 min read

Knowing how much disk space individual tables take up is important for DB maintenance and debugging, and it can be accomplished with a single query in MySQL.


The Dangers of OFFSET With MySQL
The Dangers of OFFSET With MySQL
Jul 28, 2022 · 15 min read

Large limit offsets degrade the performance of most databases, but it is especially egregious in MySQL.


Investigating Locks in MySQL
Investigating Locks in MySQL
Jun 17, 2022 · 8 min read

Locking is an important part of an ACID-compliant database, but excessive locks can lead to performance degradation. Here are some strategies for investigating locks in MySQL.


Creating a MySQL REPL Playground in Docker
Creating a MySQL REPL Playground in Docker
Apr 27, 2022 · 4 min read

It's helpful to have local throwaway environments for rapid development, especially with databases, and creating one for MySQL is a snap with Docker.


Finding Long-Running Queries in MySQL
Finding Long-Running Queries in MySQL
Dec 22, 2021 · 4 min read

Poorly optimized queries and excessive connections can cause problems in MySQL, here's a quick way to identify and kill them.


Making UUIDs More Performant in MySQL
Making UUIDs More Performant in MySQL
Nov 14, 2020 · 3 min read

MySQL does not have a native UUID type, so strings are often used instead, which come with large storage and performance costs.


Generating v4 UUIDs in MySQL
Generating v4 UUIDs in MySQL
Nov 13, 2020 · 3 min read

MySQL's UUID() function generates v1 UUIDs, which have a time component that make them unevenly distributed over short periods of time. We can define our own function to generate v4 UUIDs, which are random and therefore more evenly distributed.


Faking Sequences in MySQL
Faking Sequences in MySQL
Nov 11, 2020 · 4 min read

MySQL doesn't have a concept of custom sequences that other databases such as PostgreSQL do, but they can be faked with a table and some clever queries.