BRIN 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...7 min read·sqljournal.hashnode.devMay 7, 2025
Optimizing 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...5 min read·sqljournal.hashnode.devMar 23, 2025