ls lib/sql/
SQL and SQLite
What SQLite does with GROUP BY, and multiplying rows in SQL.
- draft How SQLite runs GROUP BY and ORDER BY ... LIMITWhat EXPLAIN QUERY PLAN's "USE TEMP B-TREE" lines really are in SQLite 3.54: GROUP BY is a merge sort, ORDER BY with a LIMIT keeps only LIMIT rows in a small B-tree, and the GROUP BY quietly borrows the ORDER BY's direction.
- draft Multiplying rows in SQL: SQLite has no PRODUCT()SQLite can sum a column but not multiply one. Why the exp(sum(ln(x))) trick got 15% of products of three numbers under 100,000 wrong, how a recursive CTE folds rows exactly, and what SQLite 3.54 does when the integers overflow.