🪤 The Fan Trap: Why Your SQL Joins Are Inflating Your Numbers

You run a query to get total revenue per customer. Customer #1 should have $500 in orders. Your query says $1,500. The raw data checks out. So what is wrong here? You just hit the fan trap — a sneaky SQL join issue that multiplies your numbers without any warning. Let me show you how it happens and how to fix it. 🤔 What Is the Fan Trap? The fan trap happens when you join tables along a one-to-many relationship and then aggregate. The “many” side fans out the rows from the “one” side, duplicating them before your SUM or COUNT ever runs. ...

February 15, 2026 · 5 min · 872 words · Me

🕳️ The Chasm Trap: Why Your SQL Is Doubling Your Numbers

You run a query to calculate total sales for Order #1. The result shows 16 items sold when your customer only bought 8. You check the database - the raw data is correct. So why is your query playing mind games? Welcome to the chasm trap. It’s a data modeling issue that silently doubles (or triples, or worse) your aggregation results. Let me show you exactly what’s happening and how to fix it. ...

January 31, 2026 · 4 min · 681 words · Me

DuckDB Inside Postgres: The Unlikely Duo Supercharging Analytics

DuckDB Inside Postgres: The Unlikely Duo Supercharging Analytics If you work in data engineering, you know that the field moves at a dizzying pace. New tools and technologies seem to pop up daily, each promising to revolutionize how we store, process, and analyze data. Amidst this constant change, two names have remained stalwarts: Postgres, the tried-and-true relational database, and DuckDB, the talented new kid on the block for analytics workloads. ...

October 30, 2024 · 9 min · 1730 words · Me