FOMO Daily
Feed
PlanetScale·

Building a faster, lazier router for Postgres

DatabasesPostgresQuery RoutingPerformanceLazy Evaluation

TL;DR

PlanetScale’s Neki router adds overhead when routing queries across PostgreSQL shards, so it avoids decoding data it doesn’t need to understand. It preserves PostgreSQL wire-format bytes, decodes only necessary parameters or columns, and uses pointers to select or reorder rows without copying them. This reduces parsing, allocations, and copying—even for some cross-shard queries—while still supporting limits and global sorting.

Read the original post Sign in to mark as read or skip