DjangoCon US 2023

Postgres Performance: From Slow to Pro
2023-10-17 , Junior Ballroom

At some point, every application is limited by the database. You don’t have to be a Postgres expert to get started with a few key performance improvements. This gentle introduction is meant for folks who’ve never ventured into their database before, or those who have been turning knobs blindly. I’ll present how Postgres uses memory. Then, I’ll connect that to how you can monitor, tune, and optimize queries. You’ll be ready to take on the challenge as your application grows.


Review of how Postgres uses memory

Measuring cache hit ratio
Measuring memory usage and tuning
Measuring shared buffer usage and tuning

Connection settings

Default connection settings, knowing when you need more

Stop runwaywas

Setting a statement timeout
Finding and stopping transactions

Query performance

Using EXPLAIN
Reading and understanding EXPLAIN plans
Logging EXPLAIN plans
Adding Indexes

Elizabeth is a Customer Success Manager at Crunchy Data and volunteers for the US PostgreSQL Association. Elizabeth enjoys writing about Postgres for Newbies and teaching people about databases whenever she gets the chance. She has a background in open source project management and enjoys working with development teams to build products and applications using all the fun things in the open source toy box. Elizabeth hails from Lawrence, Kansas and spends most of her free time pretending like she lives on a farm in the 1860s.