UmurInan
SQL Topic

SQL

SQL is a declarative language, which means the database decides how to run your query. These posts are about reading query plans, building the right indexes, understanding when the optimizer is lying to you, and the column-ordering and NULL rules that change behavior.

Backend

Posted on Apr 25, 2026

The Composite Index Nobody Can Read

Your composite index covers every column but EXPLAIN still shows a full scan. Column order, not column presence, determines whether PostgreSQL uses the index.

Read more
Backend

Posted on Apr 19, 2026

The NULL Trap

NULL is a three-valued logic system that corrupts aggregations, breaks NOT IN subqueries, and hides rows from WHERE clauses. It is not just a missing value.

Read more
Backend

Posted on Apr 17, 2026

EXPLAIN ANALYZE Lies to You

PostgreSQL's EXPLAIN ANALYZE tells you the plan looks fast. It doesn't tell you the timing is cached, the estimates are stale, or the cost isn't milliseconds.

Read more
Backend

Posted on Mar 27, 2026

Database Indexes Explained for People Who Keep Forgetting

You've read about database indexes before. You've forgotten most of it. Here's the practical guide you'll actually remember, with PostgreSQL examples.

Read more
Database

Posted on May 9, 2026 intermediate

PostgreSQL JSONB Deep Dive: Operators, Indexes, and the Tradeoffs Nobody Told You About

JSONB operators, GIN vs expression indexes, and the cost of JSONB over typed columns - all proved with EXPLAIN ANALYZE on 200k Postgres rows. Tests in the repo.

Read more
Database

Posted on Apr 25, 2026 intermediate

Database Indexes Explained: A PostgreSQL Walkthrough With EXPLAIN ANALYZE

B-tree, composite, partial indexes proved with EXPLAIN ANALYZE on 500k Postgres rows. Plus the three ways EXPLAIN ANALYZE lies to you. Tests in the repo.

Read more