4min chapter

Postgres FM cover image

Wait events

Postgres FM

CHAPTER

How to Optimize Posgus for Lightweight Locks

If you see lock weight event type i your and you can understand reading or writing you already understand that you need to pay attention to your disk subsystem. To get rid of long lock waiting for example very good trick is to use select for update either skip locked or no weight so either you fail if in case of collision on some lock acquisition  or you just skip those roles as well. Get next available not yet locked this is good for polarization of some batch processing for example. If you see lightweight lock this is sometimes maybe the trickiest part there are several lightweight locks it's about memory work with memory buffer pool and so and sometimes you need to optimize posgus itselfSometimes we look back

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode