Hacker Blogs
Work in progress: 82,651 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #1541

E

EXPLAIN EXTENDED

Personal blog · explainextended.com · on HN as quassnoiprogrammingdata

EXPLAIN EXTENDED is a personal blog at explainextended.com about programming and data. Since 2009, 46 different Hacker News readers have linked it 54 times, most often “GPT in 500 Lines of SQL”. It is still writing: the last post was on 2025-12-31, and you can follow it by feed.

Visit the blog
54mentions?
4recommend?
46HN people?
2009–2026first – last linked?
Links on Hacker News per year · peak 11 in 2024

Too few sampled comments (15) to say how often HN recommends it.?

Why HN links it

HN readers link EXPLAIN EXTENDED for deep SQL write-ups and clever database puzzles and visualisations, such as the Sultan's Riddle, Postgres snowflakes, and adjacency list vs nested sets across several databases.

Recommended for · 4 comments
'Full of jewels'; a 'loved' Postgres snowflakes post; a 'most fun' puzzle; 'knows his database internals'.

Summarised by Claude from a sample of 15 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.

How to create fast database queries

The author on HN?

quassnoi · 66 karma · member since 2009

My blog on efficient database queries in SQL: http://explainextended.com

From their public HN profile, which links to this site.

Most-linked posts?

  1. GPT in 500 Lines of SQL
    10 people · 11 mentions · first linked 2024-01-01
  2. Solving the Impossible Puzzle with PostgreSQL
    3 people · 3 mentions · first linked 2017-01-02
  3. Drawing a snowflake in PostgreSQL
    3 people · 3 mentions · first linked 2013-01-10
  4. A GIF decoder in SQL
    2 people · 2 mentions · first linked 2019-01-03
  5. Finding the best starting word for Wordle using SQL
    2 people · 2 mentions · first linked 2022-01-28
  6. /2009/09/29/adjacency-list-vs-nested-sets-mysql/
    2 people · 2 mentions · first linked 2011-01-28
  7. PostgreSQL 8.4: sampling random rows
    2 people · 2 mentions · first linked 2010-05-30
  8. Drawing fractals with PostgreSQL
    2 people · 2 mentions · first linked 2014-01-02

What Hacker News says?

  1. B1FF_PSUVM · 2024-02-24Recommends
    "It's full of jewels", as someone almost said. E.g. The Sultan’s Riddle in SQL https://explainextended.com/2016/12/31/happy-new-year-8/

    Comment linking /2016/12/31/happy-new-year-8/

    on “GPT in 500 Lines of SQL”
  2. Submitted GPT in 500 Lines of SQL as a story · 1111 points

    HN discussion
  3. Ok here is the search that first brought this issue to my attention: mysql spatial index example lft rgt I see the following order: 1: http://planet.mysql.com/entry/?id=23512 2: http://efreedom.com/Question/1-1743894/Mysql-Optimizing-Find... 3: http://explainextended.com/2009/09/29/adjacency-list-vs-nest... 4: http://stackoverflow.com/questions/1743894/mysql-optimizing-...

    Comment linking /2009/09/29/adjacency-list-vs-nested-sets-mysql/

    on “Google algorithm change launched”
  4. Submitted Awesome SQL blog as a story · 155 points

    HN discussion
  5. alexggordon · 2015-07-21Recommends
    I always loved Snowflakes[0] in postgresql. That said though, almost anything could be visualized in postgresql because of the awesome geometric[1] functions that are natively supported. Someday when I'm bored, I might try doing something like the Mona Lisa in postgres. [0] http://explainextended.com/2013/12/31/happy-new-year-5/ [1] http://www.postgresql.org/docs/9.0/static/functions-geometry...

    Comment linking /2013/12/31/happy-new-year-5/

    on “Woah that is some wild postgresql”
  6. Submitted Implementing a quantum computer emulator in SQL as a story · 70 points

    HN discussion
  7. Things like late row lookups in mysql that are not an issue in postgres https://explainextended.com/2011/02/11/late-row-lookups-inno...

    Comment linking /2011/02/11/late-row-lookups-innodb/

    on “ZetaSQL – A SQL Analyzer Framework from Google”
  8. Submitted Build a new year clock with an SQL query? Sure, why not as a story · 69 points

    HN discussion
  9. With Postgres you can also generate fireworks http://explainextended.com/2009/12/31/happy-new-year/ or snowflakes: http://explainextended.com/2011/12/31/happy-new-year-3/ Or you can solve a Sudoku riddle in Oracle https://technology.amis.nl/2009/10/13/oracle-rdbms-11gr2-sol...

    Comment linking /2011/12/31/happy-new-year-3/

    on “SQLite: Outlandish Recursive Query Examples”
  10. Submitted Drawing fractals with PostgreSQL as a story · 51 points

    HN discussion
  11. Ooohh, I didn't know this name for it, thanks. I somehow came across it as The Sultan's Riddle on the internet: https://explainextended.com/2016/12/31/happy-new-year-8/ I prefer this less sterile framing of it. It was the most fun that I ever had with a puzzle, so to anyone scrolling around on this page, I would recommend not jumping straight to the solution :)

    Comment linking /2016/12/31/happy-new-year-8/

    on ““I don't know the numbers”: a math puzzle”
  12. Submitted Things SQL needs: MERGE JOIN that would seek as a story · 28 points

    HN discussion
  13. pradocchia · 2009-11-21Recommends
    I like this style better than SQL for Smarties. Celko tries to stick with the ANSI standard, which is fine, but I much to prefer to know how to get the most out of each platform. Like here, http://explainextended.com/2009/09/ , he covers adjacency list vs. nested sets on MySQL, Postgres, Oracle and SQL Server. Different platforms, different optimal solutions. The man knows his database internals.

    Comment linking /2009/09/

    on “Awesome SQL blog”
  14. Submitted Xkcd comics which can illustrate programming questions as a story · 27 points

    HN discussion
  15. > I was AMAZED how poorly Oracle performed in one certain use case (real time aggregation of a relatively large hierarchial database) Out of interest, what kind of hierarchial database was this? Something like this? http://explainextended.com/2009/09/28/adjacency-list-vs-nest...

    Comment linking /2009/09/28/adjacency-list-vs-nested-sets-oracle/

    on “NoSQL vs. RDBMS: Let the flames begin”
  16. Submitted Things in MySQL that won't work as expected as a story · 25 points

    HN discussion
  17. https://explainextended.com/2023/12/31/happy-new-year-15/

    Comment linking /2023/12/31/happy-new-year-15/

    on “Beyond Quacking: Deep Integration of Language Models and RAG into DuckDB”
  18. Submitted GPT in 500 Lines of SQL as a story · 9 points

    HN discussion
  19. The creators understand it well. The math is pretty a lot, but, you can literally do it with pen and paper. There are plenty of blog[1] posts showing the process. Anyone claiming AI is a black box no one understands is a marketing-level drone trying to sell something that THEY don't understand. [1] https://explainextended.com/2023/12/31/happy-new-year-15/

    Comment linking /2023/12/31/happy-new-year-15/

    on “Claude Code feels like magic because it is iterative”
  20. Submitted Implementing a quantum computer emulator in SQL as a story · 8 points

    HN discussion
  21. I believe I read that in Postgres the query planner does the same thing whether you use EXISTS/NOT EXISTS or IN/NOT IN. I don't think this is true, unless it's a very recent change. Here's a post from 2009 comparing NOT IN/NOT EXISTS/LEFT JOIN WHERE IS NULL for Postgres: http://explainextended.com/2009/09/16/not-in-vs-not-exists-v...

    Comment linking /2009/09/16/not-in-vs-not-exists-vs-left-join-is-null-postgresql/

    on “Learn SQL, dammit”
  22. Submitted PostgreSQL 8.4: sampling random rows as a story · 8 points

    HN discussion
  23. You can actually do really fun (and fast!) things with dates by mapping them to geospatial types. For an example see: http://explainextended.com/2009/08/11/efficient-date-range-q... You can easily extend this map into more dimensions depending in your common use cases and the capability of your DB's spatial library.

    Comment linking /2009/08/11/efficient-date-range-query-sql-server/

    on “Show HN: Better SQL group by date”
  24. Submitted Double thinking in SQL as a story · 8 points

    HN discussion
  25. >> I've asked ChatGPT to write a VBScript function that returns false if the input is true and false if the input is false. <insert to-be-fair meme here> You purposefully asked GPT a trick question for which it likely has very little training data. No one would ever go on StackExchange et al. asking how to write a function that always returns false. So GPT had to take its training data on other, realistic questions…

    Comment linking /2023/12/31/happy-new-year-15/

    on “Ask HN: I don't use AI. What exactly am I missing out on?”
  26. Submitted Happy New Year: GPT in 500 Lines of SQL as a story · 6 points

    HN discussion
  27. For the LLM explainer, did you point Claude at this one? https://explainextended.com/2023/12/31/happy-new-year-15/ This page Claude assisted page rhymes with that one. Sorta.

    Comment linking /2023/12/31/happy-new-year-15/

    on “Show HN: Beautiful interactive explainers generated with Claude Code”
  28. Submitted Happy New Year: GPT in 500 Lines of SQL as a story · 6 points

    HN discussion
  29. Sure, especially if you nest the sets using a datatype indexable with an R-Tree index: http://explainextended.com/2009/09/29/adjacency-list-vs-nest... However, nested sets is still very expensive to update which may be a deciding factor if your hierarchy is subject to frequent change (like, a folder-like structure with the folders being moved here and there) and you don't need to query for "all descendants" often.

    Comment linking /2009/09/29/adjacency-list-vs-nested-sets-mysql/

    on “Hierarchical Queries in MySQL (Function substitute for CONNECT BY)”
  30. Submitted GPT in 500 Lines of SQL as a story · 5 points

    HN discussion

Search all of HN for explainextended.com

Linked by the same people?