Hacking on PostgreSQL is challenging. It involves a massive codebase
and a rigorous—often bottlenecked—review process. For many new
aspiring contributors, the journey often begins with excitement
tempered by imposter syndrome and confusion. How do I start? What
should I work on? These are common questions new hackers ask. This
talk offers a practical guide to navigating that maze, using the
speaker’s own journey as a roadmap.
We will explore both the technical and psychological strategies
required to move from confusion to contribution: how to start small,
how to review patches, and how reviewing can naturally generate ideas
for what to work on next. Small, focused efforts compound over time.
In this talk, we follow one such journey—from removing a simple
polling loop, to building shared infrastructure and user-facing
features; from a small bug fix, to a deeper exploration of
PostgreSQL’s evolving I/O architecture.
As a concrete case study, we examine how replacing simple
pg_usleep-based polling loops with a structured WAIT FOR LSN
infrastructure—built on latches and shared-memory pairing
heaps—resulted in a 39% reduction in CPU cycles and a 44% improvement
in IPC. We then show how streamifying the same code path can further
boost performance by more than 2× when combined with the new AIO
framework.
Attendees will learn:
• How to Start Small: Practical ways to build familiarity and
confidence through patch reviews, bug fixes, and feature testing.
• How to Avoid Polling with IPC Mechanisms: Understanding and using
core primitives such as latches and condition variables to replace
inefficient sleep-and-poll patterns.
• The WAIT FOR LSN Infrastructure and Command: How to wait for WAL to
be written, flushed, or replayed efficiently, and how to achieve
effective read-after-write consistency in asynchronous replication
settings.
• The “Streamification” Recipe: What Read Streams is, when to use it,
and how to identify code paths that can hide I/O latency and enable
asynchronous I/O.
Hopefully, this talk could demonstrate that knowledge expands
fractally and learning compounds over time. By getting close enough to
the gaps, a persistent hacker can develop understanding—and make
meaningful contributions to PostgreSQL.