PlanetScale
PlanetScale logoPlanetScale · Feature trail

Neki Query Performance

32 posts · Jun 2022 – Oct 2026

What this trail covers

Neki, PlanetScale's sharded Postgres solution, continues to evolve its architecture. This post details optimizations in query processing by minimizing unnecessary data decoding and serialization. The router now selectively decodes only required columns and parameters, and preserves original PostgreSQL wire formats where possible. This lazy and composable approach reduces network hops and processing overhead, especially for point lookups, queries with LIMIT, and cross-shard queries where full row decoding is not required. For sorting operations, specific sort keys are decoded as needed. The system also leverages protocol-level optimizations for bind parameters and column frames, and maintains original formats for text/binary data to further reduce processing.

All PlanetScale trails