Articles on Databases

Generating v7 UUIDs in MySQL
Generating v7 UUIDs in MySQL
Nov 9, 2026 · 5 min read

MySQL's UUID() function generates v1 UUIDs, which are time-based, but not time-ordered. We can define our own function to generate v7 UUIDs, which are more appropriate for primary keys.


Monitoring PostgreSQL Index Creation
Monitoring PostgreSQL Index Creation
May 9, 2026 · 3 min read

PostgreSQL has the ability to monitor the progress of index creation, which is very helpful for long-running queries.


Querying MySQL Row Counts the Fast Way
Querying MySQL Row Counts the Fast Way
Oct 5, 2025 · 7 min read

SELECT COUNT(*) requires an expensive full index scan, which probably isn't what you want.


Automatic Audit Logging with PostgreSQL Triggers
Automatic Audit Logging with PostgreSQL Triggers
Dec 12, 2024 · 11 min read

You can create an automatic audit log of changes to a table's rows by using functions, triggers, and a second table.


Calculating Table Size in MySQL
Calculating Table Size in MySQL
Sep 15, 2022 · 3 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.


Deferrable Constraints in PostgreSQL
Deferrable Constraints in PostgreSQL
Jun 20, 2022 · 10 min read

Constraints in PostgreSQL are validated immediately row-by-row by default, which might be confusing when updating multiple values in columns that have a uniqueness constraint.


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.


Inner vs. Outer Joins
Inner vs. Outer Joins
Apr 29, 2022 · 8 min read

They can't be used interchangeably, and the differences are important.


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.


Creating a PostgreSQL REPL Playground in Docker
Creating a PostgreSQL REPL Playground in Docker
Apr 27, 2022 · 3 min read

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


Creating a Gremlin REPL Playground in Docker
Creating a Gremlin REPL Playground in Docker
Apr 22, 2022 · 5 min read

Apache TinkerPop's Gremlin graph traversal language can be confusing to learn, but thankfully TinkerPop provides some "toy" graphs perfect to learn with.