jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html
Preview meta tags from the jnidzwetzki.github.io website.
Linked Hostnames
10- 13 links tojnidzwetzki.github.io
- 6 links togithub.com
- 2 links towww.linkedin.com
- 1 link toscholar.google.com
- 1 link totwitter.com
- 1 link towww.facebook.com
- 1 link towww.postgresql.org
- 1 link towww.reddit.com
Thumbnail

Search Engine Appearance
Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer
PostgreSQL uses several types of locks to coordinate parallel transactions and manage access to resources like tuples, tables, and in-memory data structures. Heavyweight locks are used to control access to tables. Lightweight locks (LWLocks) manage access to data structures, such as adding data to the write-ahead log (WAL). Row-level locks control access to individual tuples. For example, tuples need to be locked when executing an SQL statement like SELECT * FROM table WHERE i > 10 FOR UPDATE;. The tuples returned by the query are internally locked with an exclusive lock (LOCK_TUPLE_EXCLUSIVE). Another transaction attempting to lock the same tuples must wait until the first transaction releases the locks. In this article, we discuss the tool pg_row_lock_tracer, which uses eBPF and UProbes to trace PostgreSQL’s row-locking behavior. The tool can be downloaded from the pg-lock-tracer project website. This is the third article in a series about tracing PostgreSQL locks. The first article covers the tracing of heavyweight locks, and the second article focuses on LW locks.
Bing
Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer
PostgreSQL uses several types of locks to coordinate parallel transactions and manage access to resources like tuples, tables, and in-memory data structures. Heavyweight locks are used to control access to tables. Lightweight locks (LWLocks) manage access to data structures, such as adding data to the write-ahead log (WAL). Row-level locks control access to individual tuples. For example, tuples need to be locked when executing an SQL statement like SELECT * FROM table WHERE i > 10 FOR UPDATE;. The tuples returned by the query are internally locked with an exclusive lock (LOCK_TUPLE_EXCLUSIVE). Another transaction attempting to lock the same tuples must wait until the first transaction releases the locks. In this article, we discuss the tool pg_row_lock_tracer, which uses eBPF and UProbes to trace PostgreSQL’s row-locking behavior. The tool can be downloaded from the pg-lock-tracer project website. This is the third article in a series about tracing PostgreSQL locks. The first article covers the tracing of heavyweight locks, and the second article focuses on LW locks.
DuckDuckGo
Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer
PostgreSQL uses several types of locks to coordinate parallel transactions and manage access to resources like tuples, tables, and in-memory data structures. Heavyweight locks are used to control access to tables. Lightweight locks (LWLocks) manage access to data structures, such as adding data to the write-ahead log (WAL). Row-level locks control access to individual tuples. For example, tuples need to be locked when executing an SQL statement like SELECT * FROM table WHERE i > 10 FOR UPDATE;. The tuples returned by the query are internally locked with an exclusive lock (LOCK_TUPLE_EXCLUSIVE). Another transaction attempting to lock the same tuples must wait until the first transaction releases the locks. In this article, we discuss the tool pg_row_lock_tracer, which uses eBPF and UProbes to trace PostgreSQL’s row-locking behavior. The tool can be downloaded from the pg-lock-tracer project website. This is the third article in a series about tracing PostgreSQL locks. The first article covers the tracing of heavyweight locks, and the second article focuses on LW locks.
General Meta Tags
9- titleTrace PostgreSQL Row-Level Locks with pg_row_lock_tracer | Jan’s website and blog
- charsetutf-8
- viewportwidth=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=5
- generatorJekyll v3.10.0
- authorJan Nidzwetzki
Open Graph Meta Tags
8- og:imagehttps://jnidzwetzki.github.io/assets/img/flamegraph2.png
- og:typewebsite
- og:titleTrace PostgreSQL Row-Level Locks with pg_row_lock_tracer
og:locale
en_US- og:descriptionPostgreSQL uses several types of locks to coordinate parallel transactions and manage access to resources like tuples, tables, and in-memory data structures. Heavyweight locks are used to control access to tables. Lightweight locks (LWLocks) manage access to data structures, such as adding data to the write-ahead log (WAL). Row-level locks control access to individual tuples. For example, tuples need to be locked when executing an SQL statement like SELECT * FROM table WHERE i > 10 FOR UPDATE;. The tuples returned by the query are internally locked with an exclusive lock (LOCK_TUPLE_EXCLUSIVE). Another transaction attempting to lock the same tuples must wait until the first transaction releases the locks. In this article, we discuss the tool pg_row_lock_tracer, which uses eBPF and UProbes to trace PostgreSQL’s row-locking behavior. The tool can be downloaded from the pg-lock-tracer project website. This is the third article in a series about tracing PostgreSQL locks. The first article covers the tracing of heavyweight locks, and the second article focuses on LW locks.
Twitter Meta Tags
6- twitter:cardsummary
- twitter:titleTrace PostgreSQL Row-Level Locks with pg_row_lock_tracer
- twitter:descriptionPostgreSQL uses several types of locks to coordinate parallel transactions and manage access to resources like tuples, tables, and in-memory data structures....
- twitter:cardsummary
- twitter:imagehttps://jnidzwetzki.github.io/assets/img/flamegraph2.png
Link Tags
5- alternatehttps://jnidzwetzki.github.io/feed.xml
- alternatehttps://jnidzwetzki.github.io/feed.xml
- canonicalhttps://jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html
- shortcut icon/assets/favicon.ico
- stylesheet/assets/css/main.css
Emails
1Links
28- https://github.com/jnidzwetzki
- https://github.com/jnidzwetzki/pg-lock-tracer
- https://github.com/postgres/postgres/blob/2a6b47cb50eb9b62b050de2cddd03a9ac267e61f/src/backend/access/heap/heapam_handler.c#L359
- https://github.com/postgres/postgres/blob/f0827b443e6014a9d9fdcdd099603576154a3733/src/include/access/tableam.h#L71
- https://github.com/postgres/postgres/blob/f0827b443e6014a9d9fdcdd099603576154a3733/src/include/nodes/lockoptions.h#L36