JMJohn M Harperinsqljournal.hashnode.dev·May 7, 2025 · 7 min readBRIN vs B-tree Indexes in PostgreSQL: A Definitive GuideIn PostgreSQL indexing, B-tree indexes have long been the default choice for most use cases. However, BRIN indexes are often considered a more space-efficient alternative when dealing with multi-billion-row tables. But do they live up to the hype? Th...00
JMJohn M Harperinsqljournal.hashnode.dev·Mar 23, 2025 · 5 min readOptimizing SQL: Sometimes It’s About the Data, Not Just the QueryI recently came across a LinkedIn post where someone used two CTEs to pull DISTINCT merchant_ids from the same table—split by year—and then joined everything back to the orders table. It worked! But it got me thinking. Sometimes, the real challenge i...00