SESSION ON-DEMAND

All Things P99

The event for developers who care about P99 percentiles and high-performance, low-latency applications

Measuring Query Latency the Hard Way: An Adventure in Impractical Postgres Monitoring

Sampling the session state (as exposed by pg_stat_activity) is a surprisingly powerful way to understand how your Postgres instance spends its time. It is something I can wholeheartedly recommend to any Postgres DBA that needs a lightweight way to monitor query performance in production. However, it’s a terrible way to measure query latency, fraught with complexity and weird statistical biases that could be avoided by simply using an extension built for the job, or even log analysis. But pursuing terrible ideas can be fun, so in this talk, I dive into my adventures in measuring query latency from session sampling, generate some extremely funky charts, and end up unexpectedly performing a vector similarity search.

21 minutes

Simon Notley, Observability and Optimization at EnterpriseDB

Simon works at EDB where he looks after observability and deployment tooling including Postgres Enterprise Manager (PEM) and Trusted Postgres Architect (TPA). When his children occasionally allow him some free time and it's too dark, cold or wet to ride a bike, he likes to tinker with silly Postgres ideas and see how far he can take them. Very occasionally these make it as far as a blog article on sonotley.uk (exactly one post so far!).

P99 Conf Logo
P99 CONF OCT. 21 + 22, 2026

Register for Your Free Ticket

Registration includes free 30-day access to O’Reilly’s ebook library.