@Gargron @drq lol, actually, I spent too much time figuring out how to put a tree-like structure into a relational database and be able to query it fast. Ended up with each post having a "reply key" that's an array of parent post IDs up to the top-level one. It's serialized as a binary string with 4 bytes per ID, starting with top-level, and I can then query it by prefix of arbitrary length with LIKE BINARY...
I know I'm weird 😂
@grishka @Gargron @drq postgresql has the ltree extension for something like this.