jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html

Preview meta tags from the jnidzwetzki.github.io website.

Linked Hostnames

10

Thumbnail

Search Engine Appearance

Google

https://jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html

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

https://jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html

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

https://jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html

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
    • title
      Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer | Jan’s website and blog
    • charset
      utf-8
    • viewport
      width=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=5
    • generator
      Jekyll v3.10.0
    • author
      Jan Nidzwetzki
  • Open Graph Meta Tags

    8
    • og:image
      https://jnidzwetzki.github.io/assets/img/flamegraph2.png
    • og:type
      website
    • og:title
      Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer
    • US country flagog:locale
      en_US
    • og:description
      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.
  • Twitter Meta Tags

    6
    • twitter:card
      summary
    • twitter:title
      Trace PostgreSQL Row-Level Locks with pg_row_lock_tracer
    • twitter:description
      PostgreSQL uses several types of locks to coordinate parallel transactions and manage access to resources like tuples, tables, and in-memory data structures....
    • twitter:card
      summary
    • twitter:image
      https://jnidzwetzki.github.io/assets/img/flamegraph2.png
  • Link Tags

    5
    • alternate
      https://jnidzwetzki.github.io/feed.xml
    • alternate
      https://jnidzwetzki.github.io/feed.xml
    • canonical
      https://jnidzwetzki.github.io/2024/02/28/trace-postgresql-row-level-locks.html
    • shortcut icon
      /assets/favicon.ico
    • stylesheet
      /assets/css/main.css

Emails

1

Links

28