Our Personal Data Server from scratch! tranquil.farm

Simplify a cursor backfill query #653

Merged jola.dev
targeting main from jola.dev/tranquil-pds:johanna/optimize-backfill
Merged opened by and assigned to jola.dev
targeting main from jola.dev/tranquil-pds:johanna/optimize-backfill

As part of a subscriber getting caught up, we look up the oldest repo_seq row since the cursor they provided, reading out lots of data from the row, then throwing it all away and just looking at created_at. As happened to my poor baby PDS, relays can be pretty aggressive with trying to backfill and will keep triggering these lookups with no backoff, so it's worth avoiding the extra work here and limiting the query to get the created_at field only. That's about a 600x reduction in the number of bytes this lookup represents based on my PDS's data, from ~5K to 8 bytes.

I have not done the same optimization for metastore, I don't think it's as affected. The ROI is lower and the effort is higher. Might be a fun thing for someone to add if they wanted to.

Commits 0