Solving Rubik's Cubes with Computers
The first place I got into programming was making games. You can probably dig up some games I made long ago if you try hard enough (do not).In high school, my focus on programming went over to...
View ArticleSome Books I Like // One Year of NULL BITMAP
This is the 52nd NULL BITMAP, which means I have been doing this for a whole year! I skipped one week before I decided that this was going to be a weekly thing, but besides that there has been a NULL...
View ArticleThe Closed-Loop Benchmark Trap
Let's make a little mock database. It won't actually do anything but pretend to handle requests. I've had cause at work lately to write some Go so we're going to use...
View ArticleLanguages Without Abstraction
Implementing something like a compiler, there is the understanding that we want different representations of a program for different purposes. This is why we have stuff like a “control-flow graph” or...
View ArticleSQL's Grammar Ambiguity
I was going to write a longer, more involved post this week, but I wound up getting Covid and didn't have it in me to work through all the stuff I had to for that. So here is a smaller issue.I know of...
View ArticleMeasuring Throughput
Note: I'm trying out enabling comments. Behave! I reserve the right to disable them again for any reason including "the very idea of someone commenting made me anxious."We talked recently about why...
View ArticleBenchmarks That Aren't Your Friends
We’ve now talkedtwice about an important dimension of a benchmark: the openness of the loop. While there’s more subtlety to it, if what you take away is:open-loop is better for measuring latency,...
View ArticleThe Two Machines
There's a joke in my friend circle that asks "is it a database?" A startup, a program, a syscall, a person good with numbers, a person with a good memory. It's all very "is it a sandwich.” But it’s...
View ArticleIntegrity Constraints and the Relational Derivative
In a SQL database, you can set up a foreign key with...
View ArticleThe Relational Derivative Pt. 2: Groups are Good
Last week we talked about the notion of the relational derivativeand its application to enforcing integrity constraints in databases.The relational derivative is defined byAnd we can compute it by...
View ArticleSo You Want to Generate SQL Queries (me too)
We have talked before about how to appropriately test query planners.I wrote there:I love metamorphic testing for SQL databases because it in large part reduces the problem of testing a database to...
View ArticleWhen Compositionality Fails
The idea of abstraction is that we can take some complex thing and present it as some simpler thing. Where people can ignore the aspects of the thing not relevant to what they're actually trying to do...
View ArticleA Sniff Test for Some Query Optimizers
One important part of query planning is performing transformations over queries. Today I want to see how a couple common databases perform on a completely made-up and unrepresentative benchmark.I have...
View ArticleMy First Distributed System
I can show you a picture of the first distributed system I ever used: (Not entirely accurate, I had a Game Boy Color.)When I was a kid, we'd spend summers up at "the lake," where all kinds of fun stuff...
View ArticleThe Geometry of SQL
Today I want to talk about a way to think about some relational algebra operations.First, let's start with this relation:This is just a handful of games that appeared on a handful of systems, but let's...
View ArticleHeath's Theorem
We don't have all that much in the world of relational query planning that could be considered a "fundamental theorem," as in like, some central idea that everything else rests on. This is partly...
View ArticleNot all Graphs are Trees
It's pretty easy to imagine how to represent relational algebra expressions as a tree—they are already structurally rooted trees where each operator has its inputs as children.Even in a language like...
View ArticleThe Official NULL BITMAP Glossary: Graph Theory Edition
Last week a post of mine made it to God’s favourite website and one thing I was struck by was how many people disagreed about basic graph theory terminology. Some people also seemed to complain about...
View ArticleA Card Counting Trick
I used to call this thing a “game” but my friend Kevin (who is not the same Kevin as last week but who is also a mathematician) kept telling me it’s really more of a “trick.” So, it’s a trick, in the...
View ArticleNULL BITMAP Builds a Database #1: The Log is Literally the Database
It is time to end the tyranny of people becoming interested in database implementation and building a BTree. Let us turn to the succor of immutable storage.Today we are starting a new series. I know I...
View ArticleAvoiding Cross Products with the Query Graph
To compute the join of two relations, we find all pairs of rows their rows which have the same value for any columns with the same name. This is sometimes called the natural join in the software world,...
View ArticleTPC-See?
One thing about concurrency control (“isolation”) in a transactional database is that it incurs costs, and there’s broadly two kinds of such costs.The first such cost is the essential sacrifice of...
View ArticleNULL BITMAP Builds a Database #2: Enter the Memtable
I didn't realize how hard it would be to bin-pack episodes of this thing into the roughly ~750 word chunks that I try to keep issues of this newsletter at. Lots of things are like, oh that's small, so...
View ArticleIn Codd we Trust (or not)
Get in loser, we’re doing another Codd philosophizing session. Codd’s paper introducing the relational model opens up like so:Future users of large data banks must be protected from having to know how...
View ArticlePhysical Properties #4
Previous parts of this series:Physical Properties #1Physical Properties #2Physical Properties #3Relational query planning makes a distinction between "logical properties" and "physical properties."...
View ArticleTo Understand Correctness, You Must First Understand Incorrectness
Recently I was in a Discord channel where someone wrote something akin to “I have a question about linearizability” which had an attached thread with 80 replies.This is what game designers call...
View ArticleDeriving Functional Dependencies for Selections
Over the last two weeks you were babysat by the pre-scheduling feature of Buttondown, since I was away in Japan without my laptop. Here's me in Japan:I had a nice trip. To hear more about what I...
View ArticleMultiple Returns in SQL
Podcast AppearanceI was on the Thinking About Computers podcast recently! We had a fun chat on the topic of writing technical content and research. Personally I can't stand hearing my own voice so I...
View ArticleA Query Planning Guideline
A number of readers last week reached out to direct my attention to What if a SQL Statement Returned a Database which is a much more thorough and well-articulated explanation of the core idea—thank...
View ArticleWhat do we want? Negation! When do we want it? Not later!
Hello I am traveling this weekend! I am home in Ontario. I wanted to share this picture I took of this guy feeding a bear.Bear eating an object out of a guy’s handDon’t feed bears! This is not an...
View Article