Advanced SQL

JSONB in PostgreSQL: The Beginner’s Guide I Wish I Had

Michael Patrick McCoy

PostgreSQL’s JSONB data type gives you the flexibility of a document store while keeping all the relational superpowers you already know. But the truth is simple: most developers struggle with JSONB purely because they forget the syntax. This guide is the refresher I wish someone handed me years ago!


Read More

JSONB Performance: What Developers Get Wrong

Michael Patrick McCoy

PostgreSQL’s JSONB type is incredibly powerful. It’s flexible, fast, and lets developers store semi-structured data without spinning up a separate document store. But here’s the truth: most JSONB performance problems come from developers treating JSONB like a magic box instead of a real data type with real indexing rules.


Read More

PostgreSQL Locking for Humans

Michael Patrick McCoy

PostgreSQL locking feels scary — mostly because the documentation lists 15 different lock modes, half of which sound like they were named during a caffeine-fueled meeting. But here’s the truth: you only need to understand a few key concepts to debug almost every lock issue you’ll ever encounter.


Read More

PostgreSQL Data Types You’re Probably Using Wrong

Michael Patrick McCoy

PostgreSQL gives you a huge toolbox of data types, which is great — until you accidentally pick the wrong one and end up fighting performance issues, storage problems, or subtle bugs that show up months later. In this article, we’ll go over the four data type pairs developers misuse the most, and I’ll show you the simple rules that will keep your schemas clean and your data correct.


Read More

PostgreSQL Indexes Explained: How to Choose the Right One

Michael Patrick McCoy

PostgreSQL offers multiple index types, each optimized for different query patterns and data shapes. Understanding which one to use is one of the highest-ROI skills in database engineering.


Read More

Many Single-Column Indexes vs One Multi-Column Index

Michael Patrick McCoy

Indexing is one of the most misunderstood areas of PostgreSQL performance tuning. Developers often assume that “more indexes = faster queries.” This article explains when multiple single-column indexes make sense, when a multi-column index is better, and how PostgreSQL decides.


Read More