Full Code of jnidzwetzki/pg-lock-tracer for AI

main f4c66c3f0922 cached
31 files
401.3 KB
112.9k tokens
172 symbols
1 requests
Download .txt
Showing preview only (417K chars total). Download the full file or copy to clipboard to get everything.
Repository: jnidzwetzki/pg-lock-tracer
Branch: main
Commit: f4c66c3f0922
Files: 31
Total size: 401.3 KB

Directory structure:
gitextract_x8d44rn2/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── codeql.yml
│       ├── integration_tests.yml
│       ├── pr_handling.yml
│       ├── python_publish.yml
│       ├── stale.yml
│       └── tests.yml
├── .gitignore
├── LICENSE
├── README.md
├── examples/
│   ├── create_table_trace.html
│   └── create_table_trace.json
├── pylintrc
├── pyproject.toml
├── requirements_dev.txt
├── src/
│   └── pg_lock_tracer/
│       ├── __init__.py
│       ├── animate_lock_graph.py
│       ├── bpf/
│       │   ├── .clang-format
│       │   ├── __init__.py
│       │   ├── pg_lock_tracer.c
│       │   ├── pg_lw_lock_tracer.c
│       │   ├── pg_row_lock_tracer.c
│       │   └── pg_spinlock_delay_tracer.c
│       ├── helper.py
│       ├── oid_resolver.py
│       ├── pg_lock_tracer.py
│       ├── pg_lw_lock_tracer.py
│       ├── pg_row_lock_tracer.py
│       └── pg_spinlock_delay_tracer.py
└── tests/
    ├── __init__.py
    └── test_helper.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
  - package-ecosystem: "pip" # See documentation for possible values
    directory: "/" # Location of package manifests
    schedule:
      interval: "weekly"
  - package-ecosystem: "github-actions" # See documentation for possible values
    directory: "/" # Location of package manifests
    schedule:
      interval: "weekly"


================================================
FILE: .github/workflows/codeql.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
  push:
    branches: [ "main" ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ "main" ]
  schedule:
    - cron: '35 7 * * 6'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language: [ 'python' ]
        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
        # Use only 'java' to analyze code written in Java, Kotlin or both
        # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
        # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

    steps:
    - name: Checkout repository
      uses: actions/checkout@v6

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v4
      with:
        languages: ${{ matrix.language }}
        # If you wish to specify custom queries, you can do so here or in a config file.
        # By default, queries listed here will override any specified in a config file.
        # Prefix the list here with "+" to use these queries and those in the config file.

        # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
        # queries: security-extended,security-and-quality


    # Autobuild attempts to build any compiled languages  (C/C++, C#, Go, or Java).
    # If this step fails, then you should remove it and run the build manually (see below)
    - name: Autobuild
      uses: github/codeql-action/autobuild@v4

    # ℹ️ Command-line programs to run using the OS shell.
    # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

    #   If the Autobuild fails above, remove it and uncomment the following three lines.
    #   modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

    # - run: |
    #   echo "Run, Build Application using script"
    #   ./location_of_script_within_repo/buildscript.sh

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v4
      with:
        category: "/language:${{matrix.language}}"


================================================
FILE: .github/workflows/integration_tests.yml
================================================
name: Basic Integration Tests

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  config:
    strategy:
      fail-fast: false
      matrix:
        psql_version: ['14.20', '15.15', '16.11', '17.7', '18.1']
        python_version: ['3.10', '3.11', '3.12']

    name: PostgreSQL ${{ matrix.psql_version }} and Python ${{ matrix.python_version }} integration test
    runs-on: ubuntu-24.04

    steps:
      - name: Checkout source code
        uses: actions/checkout@v6

      - uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python_version }}

      - name: Show Python version
        run: python --version

      - name: Install needed tools
        run: |
          sudo apt install python3-bpfcc systemtap-sdt-dev flex bison lcov build-essential libxml2-dev libssl-dev zlib1g-dev libreadline-dev

      - name: Cache PostgreSQL build ${{ matrix.psql_version }}
        id: postgresql-cache
        uses: actions/cache@v5
        with:
          path: ~/postgresql
          key: postgresql-${{ matrix.psql_version }}-${{ hashFiles('.github/workflows/*') }}

      - name: Build PostgreSQL
        if: steps.postgresql-cache.outputs.cache-hit != 'true'
        run: |
          mkdir -p ~/postgresql
          mkdir -p ~/postgresql/src/${{ matrix.psql_version }}
          mkdir -p ~/postgresql/bin/${{ matrix.psql_version }}

          # Data dir is not part of the cache
          mkdir -p ~/postgresql_data/${{ matrix.psql_version }}

          cd ~/postgresql/src/${{ matrix.psql_version }}
          wget -q -O postgresql.tar.bz2 https://ftp.postgresql.org/pub/source/v${{ matrix.psql_version }}/postgresql-${{ matrix.psql_version }}.tar.bz2
          
          tar jxf postgresql.tar.bz2 --strip-components 1 -C .

          CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer" ./configure --prefix=$HOME/postgresql/bin/${{ matrix.psql_version }} --with-openssl --with-readline --with-zlib --with-libxml --enable-dtrace
          make -j 8

      - name: Install PostgreSQL
        run: | 
          cd ~/postgresql/src/${{ matrix.psql_version }}

          make install

          ~/postgresql/bin/${{ matrix.psql_version }}/bin/initdb -D ~/postgresql_data/${{ matrix.psql_version }}
          ~/postgresql/bin/${{ matrix.psql_version }}/bin/pg_ctl -D ~/postgresql_data/${{ matrix.psql_version }} start

          #sudo apt install curl ca-certificates gnupg
          #sudo curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null
          #sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
          #sudo apt update
          #sudo apt install postgresql-${{ matrix.psql_version }} postgresql-${{ matrix.psql_version }}-dbgsym
          #sudo /etc/init.d/postgresql start ${{ matrix.psql_version }}
          #dpkg -L postgresql-${{ matrix.psql_version }}-dbgsym
          #readelf --string-dump=.gnu_debuglink /usr/lib/postgresql/${{ matrix.psql_version }}/bin/postgres
          #objdump -TC /usr/lib/postgresql/${{ matrix.psql_version }}/bin/postgres

      - name: Install package
        run: sudo python -m pip install .
      
      - name: Check that pg_lock_tracer can be executed
        run: |
           pg_lock_tracer --version
           sudo pg_lock_tracer -x ~/postgresql/bin/${{ matrix.psql_version }}/bin/postgres -v -p $(pidof postgres) --statistics --dry-run

      - name: Check that pg_lw_lock_tracer can be executed
        run: |
           pg_lw_lock_tracer --version
           sudo pg_lw_lock_tracer -p $(pidof postgres) --dry-run

      - name: Check that pg_row_lock_tracer can be executed
        run: |
          pg_row_lock_tracer --version
          sudo pg_row_lock_tracer -x ~/postgresql/bin/${{ matrix.psql_version }}/bin/postgres -v -p $(pidof postgres) --statistics --dry-run

      - name: Check that animate_lock_graph can be executed
        run: |
           animate_lock_graph --version
           animate_lock_graph -o animation.html -i examples/create_table_trace.json
           diff animation.html -i examples/create_table_trace.html

      - name: Check that pg_spinlock_delay_tracer can be executed
        run: |
           pg_spinlock_delay_tracer --version
           sudo pg_spinlock_delay_tracer -x ~/postgresql/bin/${{ matrix.psql_version }}/bin/postgres -v -p $(pidof postgres) --dry-run


================================================
FILE: .github/workflows/pr_handling.yml
================================================
name: PR Handling

#################
# NOTE: We are using pull_request_target here:
#       https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
#       
#       So, only API calls should be made in the actions defined here. The
#       committed code should _NOT_ be touched in any case.
#################

on:
  pull_request_target:
    types: [ opened, reopened ]
    
jobs:
  assign-pr:
    name: Assign PR to author
    runs-on: ubuntu-latest
    steps:
      - uses: toshimaru/auto-author-assign@v3.0.2
 


================================================
FILE: .github/workflows/python_publish.yml
================================================
# Based on https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml
name: Upload Python Package

on:
  release:
    types: [published]

permissions:
  contents: read

jobs:
  deploy:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v6

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install build
        pip install twine
        pip install dunamai
        # See https://github.com/pypa/twine/issues/1216
        pip install -U packaging
    
    - name: Show version based on git tag
      run: dunamai from git --style semver

    - name: Ensure that program and tag version match
      if: github.event_name == 'release'
      run: |
        PACKAGE_VERSION=$(python -c "from src.pg_lock_tracer import __version__; print(__version__)")
        GIT_VERSION=$(dunamai from git --style semver)
        if [[ "$PACKAGE_VERSION" != "$GIT_VERSION" ]]; then
           echo "Version mismatch ${PACKAGE_VERSION} / ${GIT_VERSION}"
           exit 1
        fi

    - name: Build package
      run: python -m build

    - name: Upload to test.pypi
      if: github.event_name == 'release'
      run: 'twine upload --non-interactive --repository testpypi dist/*'
      env:
        TWINE_USERNAME: '__token__'
        TWINE_PASSWORD: '${{ secrets.TWINE_PASSWORD_TEST }}'

    - name: Upload to pypi
      if: github.event_name == 'release'
      run: 'twine upload --non-interactive dist/*'
      env:
        TWINE_USERNAME: '__token__'
        TWINE_PASSWORD: '${{ secrets.TWINE_PASSWORD }}'


================================================
FILE: .github/workflows/stale.yml
================================================
name: 'Close stale issues'
"on":
  schedule:
    - cron: '30 1 * * *'
  workflow_dispatch:

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v10
        with:
          # Don't process PRs
          days-before-stale: -1

          # Process only issues
          days-before-issue-stale: 60
          days-before-issue-close: 30

          # Add this label after 'days-before-issue-stale' days to mark it as stale
          stale-issue-label: 'no-activity'

          # Process only issues that contain the label 'waiting-for-author'
          only-labels: 'need-more-info'

          close-issue-message: 'This issue was closed because it has been stalled for several weeks with no activity.'


================================================
FILE: .github/workflows/tests.yml
================================================
name: Basic Project Tests
on:
  pull_request:
  push:
    branches:
      - main

jobs:
  tests:
    name: Perform unit tests
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Install needed tools
        run: |
          sudo apt update
          sudo apt install python3-bpfcc

      - name: Setup python 3.10
        uses: actions/setup-python@v6
        with:
          python-version: '3.10'

      - name: Copy distribution BPF packages
        run: cp -av /usr/lib/python3/dist-packages/bcc* $(python -c "import sysconfig; print(sysconfig.get_path('platlib'))")

      - name: Install package
        run: python -m pip install .

      - name: Install development requirements
        run: python -m pip install -r requirements_dev.txt

      - name: Execute unit tests
        run: pytest

  linter:
    name: Run Linter and check formatting
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Install needed tools
        run: |
          sudo apt update
          sudo apt install clang-format python3-bpfcc

      - name: Install development requirements
        run: python -m pip install -r requirements_dev.txt

      - name: Run pylint
        run: pylint src tests
  
      - name: Check code format with black
        run: black --check --diff src tests
      
      - name: Run clang-format
        run: clang-format --dry-run --Werror src/pg_lock_tracer/bpf/*.c


================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
#   However, in case of collaboration, if having platform-specific dependencies or dependencies
#   having no cross-platform support, pipenv may install dependencies that don't work, or not
#   install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# VScode
.vscode/

================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [2022] [Jan Nidzwetzki]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
# Lock tracing tools for PostgreSQL
[![Build Status](https://github.com/jnidzwetzki/pg-lock-tracer/actions/workflows/tests.yml/badge.svg)](https://github.com/jnidzwetzki/pg-lock-tracer/actions/workflows/tests.yml)
[![PyPI](https://img.shields.io/pypi/v/pg-lock-tracer?color=green)](https://pypi.org/project/pg-lock-tracer/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/pg-lock-tracer)](https://pypi.org/project/pg-lock-tracer/)
[![Release date](https://img.shields.io/github/release-date/jnidzwetzki/pg-lock-tracer)](https://github.com/jnidzwetzki/pg-lock-tracer/)
[![GitHub Repo stars](https://img.shields.io/github/stars/jnidzwetzki/pg-lock-tracer?style=social)](https://github.com/jnidzwetzki/pg-lock-tracer/)

A set of eBPF-based tools designed to observe and visualize PostgreSQL 🐘 locking activity. These tools help users understand lock timing and contention behavior.

Key components:

- `pg_lock_tracer`: heavy lock tracer (e.g., table level locks)
- `pg_lw_lock_tracer`: lightweight lock (LWLock) tracer
- `pg_row_lock_tracer`: row-level lock tracer
- `pg_spinlock_delay_tracer`: spinlock delay tracer
- `animate_lock_graph`: render animated lock graphs from `pg_lock_tracer` tracer output

__Note:__ These tools rely on [eBPF](https://ebpf.io/) (_Extended Berkeley Packet Filter_) technology. At the moment, PostgreSQL 14, 15, 16, 17, and 18 are supported (see additional information below).


## ⚡ Quickstart
1. Install the pg-lock-tracer tools:

```
$ pip install pg-lock-tracer
```

2. Identify the PostgreSQL server binary used by your instance (e.g., `/usr/lib/postgresql/X/bin/postgres`).
3. Start tracing a running Postgres PID (requires root privileges):

```
$ sudo pg_lock_tracer -x /path/to/postgres
```

This shows the locking activity of all processes running this PostgreSQL binary. 

# pg_lock_tracer
`pg_lock_tracer` observes the locking activity of a running PostgreSQL process (using _eBPF_ and _UProbes_). In contrast to the information that is present in the table `pg_locks` (which provides information about which locks are _currently_ requested), `pg_lock_tracer` gives you a continuous view of the locking activity and collects statistics and timings.

The tracer also allows dumping the output as JSON-formatted lines, which allows further processing with additional tools. This repository also contains the script `animate_lock_graph`, which provides an animated version of the taken looks.

## 🧪 Usage Examples
```
# Trace use binary '/home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres' for tracing
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres

# Trace use binary '/home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres' for tracing and trace pid 1234
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234

# Trace two PIDs
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -p 5678

# Be verbose
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -v 

# Use the given db connection to access the catalog of PID 1234 to resolve OIDs
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -r 1234:psql://jan@localhost/test2

# Output in JSON format
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -j

# Print stacktrace on deadlock
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -s DEADLOCK

# Print stacktrace for locks and deadlocks
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -s LOCK DEADLOCK

# Trace only Transaction and Query related events
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -t TRANSACTION QUERY

# Write the output into file 'trace'
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -o trace

# Show statistics about locks
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 --statistics

# Create an animated lock graph (with Oids)
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -j -o locks.json
animate_lock_graph -i lock -o locks.html

# Create an animated lock graph (with table names)
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_15_1_DEBUG/bin/postgres -p 1234 -j -r 1234:psql://jan@localhost/test2 -o locks.json
animate_lock_graph -i lock -o locks.html
```

## 📄 Example Output

CLI: `pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_14_2_DEBUG/bin/postgres -p 327578 -r 327578:sql://jan@localhost/test2 --statistics`

SQL Query: `create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);`

Tracer Output:

```
745064333930117 [Pid 327578] Query begin 'create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);'
745064333965769 [Pid 327578] Transaction begin
745064334157640 [Pid 327578] Table open 3079 (pg_catalog.pg_extension) AccessShareLock
745064334176147 [Pid 327578] Lock object 3079 (pg_catalog.pg_extension) AccessShareLock
745064334204453 [Pid 327578] Lock granted (fastpath) 3079 (pg_catalog.pg_extension) AccessShareLock
745064334224361 [Pid 327578] Lock granted (local) 3079 (pg_catalog.pg_extension) AccessShareLock (Already hold local 0)
745064334243659 [Pid 327578] Lock was acquired in 67512 ns
[...]
```

<details>
  <summary>Full Output</summary>

```
===> Ready to trace queries
745064333930117 [Pid 327578] Query begin 'create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);'
745064333965769 [Pid 327578] Transaction begin
745064334157640 [Pid 327578] Table open 3079 (pg_catalog.pg_extension) AccessShareLock
745064334176147 [Pid 327578] Lock object 3079 (pg_catalog.pg_extension) AccessShareLock
745064334204453 [Pid 327578] Lock granted (fastpath) 3079 (pg_catalog.pg_extension) AccessShareLock
745064334224361 [Pid 327578] Lock granted (local) 3079 (pg_catalog.pg_extension) AccessShareLock (Already hold local 0)
745064334243659 [Pid 327578] Lock was acquired in 67512 ns
745064334285877 [Pid 327578] Lock object 3081 (pg_catalog.pg_extension_name_index) AccessShareLock
745064334309610 [Pid 327578] Lock granted (fastpath) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock
745064334328475 [Pid 327578] Lock granted (local) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock (Already hold local 0)
745064334345266 [Pid 327578] Lock was acquired in 59389 ns
745064334562977 [Pid 327578] Lock ungranted (fastpath) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock
745064334583578 [Pid 327578] Lock ungranted (local) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock (Hold local 0)
745064334608957 [Pid 327578] Table close 3079 (pg_catalog.pg_extension) AccessShareLock
745064334631046 [Pid 327578] Lock ungranted (fastpath) 3079 (pg_catalog.pg_extension) AccessShareLock
745064334649932 [Pid 327578] Lock ungranted (local) 3079 (pg_catalog.pg_extension) AccessShareLock (Hold local 0)
745064334671897 [Pid 327578] Table open 3079 (pg_catalog.pg_extension) AccessShareLock
745064334688382 [Pid 327578] Lock object 3079 (pg_catalog.pg_extension) AccessShareLock
745064334712042 [Pid 327578] Lock granted (fastpath) 3079 (pg_catalog.pg_extension) AccessShareLock
745064334731081 [Pid 327578] Lock granted (local) 3079 (pg_catalog.pg_extension) AccessShareLock (Already hold local 0)
745064334748288 [Pid 327578] Lock was acquired in 59906 ns
745064334772367 [Pid 327578] Lock object 3081 (pg_catalog.pg_extension_name_index) AccessShareLock
745064334795943 [Pid 327578] Lock granted (fastpath) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock
745064334814983 [Pid 327578] Lock granted (local) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock (Already hold local 0)
745064334832570 [Pid 327578] Lock was acquired in 60203 ns
745064334953192 [Pid 327578] Lock ungranted (fastpath) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock
745064334973518 [Pid 327578] Lock ungranted (local) 3081 (pg_catalog.pg_extension_name_index) AccessShareLock (Hold local 0)
745064334997936 [Pid 327578] Table close 3079 (pg_catalog.pg_extension) AccessShareLock
745064335019473 [Pid 327578] Lock ungranted (fastpath) 3079 (pg_catalog.pg_extension) AccessShareLock
745064335037880 [Pid 327578] Lock ungranted (local) 3079 (pg_catalog.pg_extension) AccessShareLock (Hold local 0)
745064335901618 [Pid 327578] Table open 1259 (pg_catalog.pg_class) AccessShareLock
745064335918354 [Pid 327578] Lock object 1259 (pg_catalog.pg_class) AccessShareLock
745064335941911 [Pid 327578] Lock granted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064335960211 [Pid 327578] Lock granted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Already hold local 0)
745064335976642 [Pid 327578] Lock was acquired in 58288 ns
745064335999654 [Pid 327578] Lock object 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock
745064336022776 [Pid 327578] Lock granted (fastpath) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock
745064336040926 [Pid 327578] Lock granted (local) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock (Already hold local 0)
745064336057158 [Pid 327578] Lock was acquired in 57504 ns
745064336187786 [Pid 327578] Lock ungranted (fastpath) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock
745064336207011 [Pid 327578] Lock ungranted (local) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock (Hold local 0)
745064336230761 [Pid 327578] Table close 1259 (pg_catalog.pg_class) AccessShareLock
745064336252413 [Pid 327578] Lock ungranted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064336270811 [Pid 327578] Lock ungranted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Hold local 0)
745064336314237 [Pid 327578] Lock granted 2615 (pg_catalog.pg_namespace) AccessShareLock (Requested locks 1)
745064336331450 [Pid 327578] Lock granted (local) 2615 (pg_catalog.pg_namespace) AccessShareLock (Already hold local 0)
745064336402316 [Pid 327578] Lock granted (local) 2615 (pg_catalog.pg_namespace) AccessShareLock (Already hold local 1)
745064336543618 [Pid 327578] Table open 1259 (pg_catalog.pg_class) RowExclusiveLock
745064336560502 [Pid 327578] Lock object 1259 (pg_catalog.pg_class) RowExclusiveLock
745064336584633 [Pid 327578] Lock granted (fastpath) 1259 (pg_catalog.pg_class) RowExclusiveLock
745064336602915 [Pid 327578] Lock granted (local) 1259 (pg_catalog.pg_class) RowExclusiveLock (Already hold local 0)
745064336619969 [Pid 327578] Lock was acquired in 59467 ns
745064336655328 [Pid 327578] Table open 1247 (pg_catalog.pg_type) AccessShareLock
745064336671769 [Pid 327578] Lock object 1247 (pg_catalog.pg_type) AccessShareLock
745064336696072 [Pid 327578] Lock granted (fastpath) 1247 (pg_catalog.pg_type) AccessShareLock
745064336714540 [Pid 327578] Lock granted (local) 1247 (pg_catalog.pg_type) AccessShareLock (Already hold local 0)
745064336731130 [Pid 327578] Lock was acquired in 59361 ns
745064336755221 [Pid 327578] Lock object 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock
745064336778586 [Pid 327578] Lock granted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock
745064336797018 [Pid 327578] Lock granted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock (Already hold local 0)
745064336813397 [Pid 327578] Lock was acquired in 58176 ns
745064336932804 [Pid 327578] Lock ungranted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock
745064336952174 [Pid 327578] Lock ungranted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock (Hold local 0)
745064336975237 [Pid 327578] Table close 1247 (pg_catalog.pg_type) AccessShareLock
745064336996581 [Pid 327578] Lock ungranted (fastpath) 1247 (pg_catalog.pg_type) AccessShareLock
745064337014858 [Pid 327578] Lock ungranted (local) 1247 (pg_catalog.pg_type) AccessShareLock (Hold local 0)
745064337047504 [Pid 327578] Lock object 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064337070928 [Pid 327578] Lock granted (fastpath) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064337089515 [Pid 327578] Lock granted (local) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock (Already hold local 0)
745064337106032 [Pid 327578] Lock was acquired in 58528 ns
745064337183488 [Pid 327578] Lock ungranted (fastpath) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064337202563 [Pid 327578] Lock ungranted (local) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock (Hold local 0)
745064337621853 [Pid 327578] Table open 1247 (pg_catalog.pg_type) AccessShareLock
745064337638996 [Pid 327578] Lock object 1247 (pg_catalog.pg_type) AccessShareLock
745064337661950 [Pid 327578] Lock granted (fastpath) 1247 (pg_catalog.pg_type) AccessShareLock
745064337681169 [Pid 327578] Lock granted (local) 1247 (pg_catalog.pg_type) AccessShareLock (Already hold local 0)
745064337697945 [Pid 327578] Lock was acquired in 58949 ns
745064337723254 [Pid 327578] Lock object 2703 (pg_catalog.pg_type_oid_index) AccessShareLock
745064337746949 [Pid 327578] Lock granted (fastpath) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock
745064337765491 [Pid 327578] Lock granted (local) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock (Already hold local 0)
745064337781897 [Pid 327578] Lock was acquired in 58643 ns
745064337865717 [Pid 327578] Lock ungranted (fastpath) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock
745064337885245 [Pid 327578] Lock ungranted (local) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock (Hold local 0)
745064337907299 [Pid 327578] Table close 1247 (pg_catalog.pg_type) AccessShareLock
745064337928390 [Pid 327578] Lock ungranted (fastpath) 1247 (pg_catalog.pg_type) AccessShareLock
745064337946792 [Pid 327578] Lock ungranted (local) 1247 (pg_catalog.pg_type) AccessShareLock (Hold local 0)
745064337970694 [Pid 327578] Table open 1247 (pg_catalog.pg_type) RowExclusiveLock
745064337987065 [Pid 327578] Lock object 1247 (pg_catalog.pg_type) RowExclusiveLock
745064338010254 [Pid 327578] Lock granted (fastpath) 1247 (pg_catalog.pg_type) RowExclusiveLock
745064338028898 [Pid 327578] Lock granted (local) 1247 (pg_catalog.pg_type) RowExclusiveLock (Already hold local 0)
745064338045413 [Pid 327578] Lock was acquired in 58348 ns
745064338073508 [Pid 327578] Lock object 2703 (pg_catalog.pg_type_oid_index) AccessShareLock
745064338096688 [Pid 327578] Lock granted (fastpath) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock
745064338114955 [Pid 327578] Lock granted (local) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock (Already hold local 0)
745064338131934 [Pid 327578] Lock was acquired in 58426 ns
745064338198858 [Pid 327578] Lock ungranted (fastpath) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock
745064338218267 [Pid 327578] Lock ungranted (local) 2703 (pg_catalog.pg_type_oid_index) AccessShareLock (Hold local 0)
745064338257754 [Pid 327578] Lock object 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock
745064338281754 [Pid 327578] Lock granted (fastpath) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock
745064338300356 [Pid 327578] Lock granted (local) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock (Already hold local 0)
745064338317100 [Pid 327578] Lock was acquired in 59346 ns
745064338343423 [Pid 327578] Lock object 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock
745064338366354 [Pid 327578] Lock granted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock
745064338384776 [Pid 327578] Lock granted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock (Already hold local 0)
745064338401188 [Pid 327578] Lock was acquired in 57765 ns
745064338925851 [Pid 327578] Lock ungranted (fastpath) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock
745064338945562 [Pid 327578] Lock ungranted (local) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock (Hold local 0)
745064338969060 [Pid 327578] Lock ungranted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock
745064338987686 [Pid 327578] Lock ungranted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock (Hold local 0)
745064339016433 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064339032833 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064339056324 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064339075245 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064339092056 [Pid 327578] Lock was acquired in 59223 ns
745064339118530 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339141606 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339159893 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064339176278 [Pid 327578] Lock was acquired in 57748 ns
745064339275302 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339295035 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064339320204 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339343605 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339362550 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064339379189 [Pid 327578] Lock was acquired in 58985 ns
745064339466953 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339486483 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064339512103 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339535492 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339554170 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064339570785 [Pid 327578] Lock was acquired in 58682 ns
745064339661539 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339680770 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064339706403 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339731859 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339750907 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064339767580 [Pid 327578] Lock was acquired in 61177 ns
745064339855776 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064339875244 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064339898815 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064339920526 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064339939861 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064339961989 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064339978907 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064340001670 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064340020405 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064340036728 [Pid 327578] Lock was acquired in 57821 ns
745064340060373 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064340083157 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064340101890 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064340118486 [Pid 327578] Lock was acquired in 58113 ns
745064340198186 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064340219330 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064340250646 [Pid 327578] Lock object 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064340274684 [Pid 327578] Lock granted (fastpath) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064340293524 [Pid 327578] Lock granted (local) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock (Already hold local 0)
745064340310202 [Pid 327578] Lock was acquired in 59556 ns
745064340337112 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064340360031 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064340378739 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock (Already hold local 0)
745064340395496 [Pid 327578] Lock was acquired in 58384 ns
745064340576666 [Pid 327578] Lock ungranted (fastpath) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064340596299 [Pid 327578] Lock ungranted (local) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock (Hold local 0)
745064340620661 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064340639350 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock (Hold local 0)
745064340660990 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064340682154 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064340700466 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064340724983 [Pid 327578] Table close 1247 (pg_catalog.pg_type) RowExclusiveLock
745064340745747 [Pid 327578] Lock ungranted (fastpath) 1247 (pg_catalog.pg_type) RowExclusiveLock
745064340763978 [Pid 327578] Lock ungranted (local) 1247 (pg_catalog.pg_type) RowExclusiveLock (Hold local 0)
745064340789474 [Pid 327578] Table open 1247 (pg_catalog.pg_type) AccessShareLock
745064340805855 [Pid 327578] Lock object 1247 (pg_catalog.pg_type) AccessShareLock
745064340828989 [Pid 327578] Lock granted (fastpath) 1247 (pg_catalog.pg_type) AccessShareLock
745064340847526 [Pid 327578] Lock granted (local) 1247 (pg_catalog.pg_type) AccessShareLock (Already hold local 0)
745064340864256 [Pid 327578] Lock was acquired in 58401 ns
745064340885838 [Pid 327578] Lock object 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock
745064340909039 [Pid 327578] Lock granted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock
745064340928115 [Pid 327578] Lock granted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock (Already hold local 0)
745064340944601 [Pid 327578] Lock was acquired in 58763 ns
745064341048196 [Pid 327578] Lock ungranted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock
745064341067296 [Pid 327578] Lock ungranted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) AccessShareLock (Hold local 0)
745064341090013 [Pid 327578] Table close 1247 (pg_catalog.pg_type) AccessShareLock
745064341111287 [Pid 327578] Lock ungranted (fastpath) 1247 (pg_catalog.pg_type) AccessShareLock
745064341129580 [Pid 327578] Lock ungranted (local) 1247 (pg_catalog.pg_type) AccessShareLock (Hold local 0)
745064341157165 [Pid 327578] Table open 1247 (pg_catalog.pg_type) RowExclusiveLock
745064341173685 [Pid 327578] Lock object 1247 (pg_catalog.pg_type) RowExclusiveLock
745064341196776 [Pid 327578] Lock granted (fastpath) 1247 (pg_catalog.pg_type) RowExclusiveLock
745064341215241 [Pid 327578] Lock granted (local) 1247 (pg_catalog.pg_type) RowExclusiveLock (Already hold local 0)
745064341231900 [Pid 327578] Lock was acquired in 58215 ns
745064341268528 [Pid 327578] Lock object 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock
745064341292333 [Pid 327578] Lock granted (fastpath) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock
745064341341162 [Pid 327578] Lock granted (local) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock (Already hold local 0)
745064341358832 [Pid 327578] Lock was acquired in 90304 ns
745064341383548 [Pid 327578] Lock object 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock
745064341406525 [Pid 327578] Lock granted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock
745064341424954 [Pid 327578] Lock granted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock (Already hold local 0)
745064341441633 [Pid 327578] Lock was acquired in 58085 ns
745064341627523 [Pid 327578] Lock ungranted (fastpath) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock
745064341646818 [Pid 327578] Lock ungranted (local) 2703 (pg_catalog.pg_type_oid_index) RowExclusiveLock (Hold local 0)
745064341670307 [Pid 327578] Lock ungranted (fastpath) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock
745064341688874 [Pid 327578] Lock ungranted (local) 2704 (pg_catalog.pg_type_typname_nsp_index) RowExclusiveLock (Hold local 0)
745064341718375 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064341735109 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064341758861 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064341777284 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064341793917 [Pid 327578] Lock was acquired in 58808 ns
745064341817673 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064341840607 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064341859012 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064341875436 [Pid 327578] Lock was acquired in 57763 ns
745064341968082 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064341987340 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064342012766 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342036033 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342054445 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064342070843 [Pid 327578] Lock was acquired in 58077 ns
745064342158890 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342177887 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064342203087 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342226414 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342245026 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064342261449 [Pid 327578] Lock was acquired in 58362 ns
745064342345876 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342364857 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064342389842 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342412949 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342431353 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064342488520 [Pid 327578] Lock was acquired in 98678 ns
745064342575520 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342594610 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064342619914 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342643371 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342662066 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064342678513 [Pid 327578] Lock was acquired in 58599 ns
745064342770413 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342790169 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064342845082 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342868911 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064342888807 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064342905919 [Pid 327578] Lock was acquired in 60837 ns
745064342994114 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064343014416 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064343039456 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343061781 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343081935 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064343104591 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343121705 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343145901 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343165164 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064343182282 [Pid 327578] Lock was acquired in 60577 ns
745064343207310 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064343231307 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064343250703 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064343267770 [Pid 327578] Lock was acquired in 60460 ns
745064343347934 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064343367921 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064343398614 [Pid 327578] Lock object 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064343423194 [Pid 327578] Lock granted (fastpath) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064343442803 [Pid 327578] Lock granted (local) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock (Already hold local 0)
745064343459844 [Pid 327578] Lock was acquired in 61230 ns
745064343485455 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064343509461 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064343528810 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock (Already hold local 0)
745064343545847 [Pid 327578] Lock was acquired in 60392 ns
745064343695078 [Pid 327578] Lock ungranted (fastpath) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064343715321 [Pid 327578] Lock ungranted (local) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock (Hold local 0)
745064343740180 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064343759691 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock (Hold local 0)
745064343782057 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343803974 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064343823230 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064343848289 [Pid 327578] Table close 1247 (pg_catalog.pg_type) RowExclusiveLock
745064343870083 [Pid 327578] Lock ungranted (fastpath) 1247 (pg_catalog.pg_type) RowExclusiveLock
745064343889205 [Pid 327578] Lock ungranted (local) 1247 (pg_catalog.pg_type) RowExclusiveLock (Hold local 0)
745064343926948 [Pid 327578] Lock object 2662 (pg_catalog.pg_class_oid_index) RowExclusiveLock
745064343951401 [Pid 327578] Lock granted (fastpath) 2662 (pg_catalog.pg_class_oid_index) RowExclusiveLock
745064343970873 [Pid 327578] Lock granted (local) 2662 (pg_catalog.pg_class_oid_index) RowExclusiveLock (Already hold local 0)
745064343987792 [Pid 327578] Lock was acquired in 60844 ns
745064344013730 [Pid 327578] Lock object 2663 (pg_catalog.pg_class_relname_nsp_index) RowExclusiveLock
745064344038107 [Pid 327578] Lock granted (fastpath) 2663 (pg_catalog.pg_class_relname_nsp_index) RowExclusiveLock
745064344058417 [Pid 327578] Lock granted (local) 2663 (pg_catalog.pg_class_relname_nsp_index) RowExclusiveLock (Already hold local 0)
745064344075613 [Pid 327578] Lock was acquired in 61883 ns
745064344101275 [Pid 327578] Lock object 3455 (pg_catalog.pg_class_tblspc_relfilenode_index) RowExclusiveLock
745064344125438 [Pid 327578] Lock granted (fastpath) 3455 (pg_catalog.pg_class_tblspc_relfilenode_index) RowExclusiveLock
745064344144823 [Pid 327578] Lock granted (local) 3455 (pg_catalog.pg_class_tblspc_relfilenode_index) RowExclusiveLock (Already hold local 0)
745064344161792 [Pid 327578] Lock was acquired in 60517 ns
745064344396301 [Pid 327578] Lock ungranted (fastpath) 2662 (pg_catalog.pg_class_oid_index) RowExclusiveLock
745064344416716 [Pid 327578] Lock ungranted (local) 2662 (pg_catalog.pg_class_oid_index) RowExclusiveLock (Hold local 0)
745064344442093 [Pid 327578] Lock ungranted (fastpath) 2663 (pg_catalog.pg_class_relname_nsp_index) RowExclusiveLock
745064344461627 [Pid 327578] Lock ungranted (local) 2663 (pg_catalog.pg_class_relname_nsp_index) RowExclusiveLock (Hold local 0)
745064344486604 [Pid 327578] Lock ungranted (fastpath) 3455 (pg_catalog.pg_class_tblspc_relfilenode_index) RowExclusiveLock
745064344506759 [Pid 327578] Lock ungranted (local) 3455 (pg_catalog.pg_class_tblspc_relfilenode_index) RowExclusiveLock (Hold local 0)
745064344530484 [Pid 327578] Table open 1249 (pg_catalog.pg_attribute) RowExclusiveLock
745064344548232 [Pid 327578] Lock object 1249 (pg_catalog.pg_attribute) RowExclusiveLock
745064344572515 [Pid 327578] Lock granted (fastpath) 1249 (pg_catalog.pg_attribute) RowExclusiveLock
745064344592394 [Pid 327578] Lock granted (local) 1249 (pg_catalog.pg_attribute) RowExclusiveLock (Already hold local 0)
745064344609832 [Pid 327578] Lock was acquired in 61600 ns
745064344638223 [Pid 327578] Lock object 2658 (pg_catalog.pg_attribute_relid_attnam_index) RowExclusiveLock
745064344662911 [Pid 327578] Lock granted (fastpath) 2658 (pg_catalog.pg_attribute_relid_attnam_index) RowExclusiveLock
745064344682442 [Pid 327578] Lock granted (local) 2658 (pg_catalog.pg_attribute_relid_attnam_index) RowExclusiveLock (Already hold local 0)
745064344699381 [Pid 327578] Lock was acquired in 61158 ns
745064344726938 [Pid 327578] Lock object 2659 (pg_catalog.pg_attribute_relid_attnum_index) RowExclusiveLock
745064344751669 [Pid 327578] Lock granted (fastpath) 2659 (pg_catalog.pg_attribute_relid_attnum_index) RowExclusiveLock
745064344771221 [Pid 327578] Lock granted (local) 2659 (pg_catalog.pg_attribute_relid_attnum_index) RowExclusiveLock (Already hold local 0)
745064344788278 [Pid 327578] Lock was acquired in 61340 ns
745064345099100 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345117485 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345142284 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345161787 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064345178996 [Pid 327578] Lock was acquired in 61511 ns
745064345204505 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345228926 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345248442 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064345265473 [Pid 327578] Lock was acquired in 60968 ns
745064345393173 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345413932 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064345438503 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345461015 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345480576 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064345502818 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345519944 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345544039 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345563246 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064345580361 [Pid 327578] Lock was acquired in 60417 ns
745064345605327 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345629516 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345648760 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064345665722 [Pid 327578] Lock was acquired in 60395 ns
745064345752239 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345772579 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064345796763 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345822035 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345841159 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064345863107 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345879945 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345904002 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064345923102 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064345939934 [Pid 327578] Lock was acquired in 59989 ns
745064345964544 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064345988395 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064346007719 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064346024410 [Pid 327578] Lock was acquired in 59866 ns
745064346111281 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064346131283 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064346155446 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064346177619 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064346196627 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064346803127 [Pid 327578] Lock ungranted (fastpath) 2658 (pg_catalog.pg_attribute_relid_attnam_index) RowExclusiveLock
745064346823666 [Pid 327578] Lock ungranted (local) 2658 (pg_catalog.pg_attribute_relid_attnam_index) RowExclusiveLock (Hold local 0)
745064346848221 [Pid 327578] Lock ungranted (fastpath) 2659 (pg_catalog.pg_attribute_relid_attnum_index) RowExclusiveLock
745064346867396 [Pid 327578] Lock ungranted (local) 2659 (pg_catalog.pg_attribute_relid_attnum_index) RowExclusiveLock (Hold local 0)
745064346889677 [Pid 327578] Table close 1249 (pg_catalog.pg_attribute) RowExclusiveLock
745064346911402 [Pid 327578] Lock ungranted (fastpath) 1249 (pg_catalog.pg_attribute) RowExclusiveLock
745064346930609 [Pid 327578] Lock ungranted (local) 1249 (pg_catalog.pg_attribute) RowExclusiveLock (Hold local 0)
745064346954599 [Pid 327578] Table open 1214 (pg_catalog.pg_shdepend) RowExclusiveLock
745064346971633 [Pid 327578] Lock object 1214 (pg_catalog.pg_shdepend) RowExclusiveLock
745064347005777 [Pid 327578] Lock granted 1214 (pg_catalog.pg_shdepend) RowExclusiveLock (Requested locks 1)
745064347024111 [Pid 327578] Lock granted (local) 1214 (pg_catalog.pg_shdepend) RowExclusiveLock (Already hold local 0)
745064347042353 [Pid 327578] Lock was acquired in 70720 ns
745064347068452 [Pid 327578] Lock object 1233 (pg_catalog.pg_shdepend_reference_index) AccessShareLock
745064347099104 [Pid 327578] Lock granted 1233 (pg_catalog.pg_shdepend_reference_index) AccessShareLock (Requested locks 1)
745064347116884 [Pid 327578] Lock granted (local) 1233 (pg_catalog.pg_shdepend_reference_index) AccessShareLock (Already hold local 0)
745064347134876 [Pid 327578] Lock was acquired in 66424 ns
745064347218507 [Pid 327578] Lock ungranted 1233 (pg_catalog.pg_shdepend_reference_index) AccessShareLock (Requested locks 1)
745064347242474 [Pid 327578] Lock ungranted (local) 1233 (pg_catalog.pg_shdepend_reference_index) AccessShareLock (Hold local 0)
745064347266550 [Pid 327578] Table close 1214 (pg_catalog.pg_shdepend) RowExclusiveLock
745064347289588 [Pid 327578] Lock ungranted 1214 (pg_catalog.pg_shdepend) RowExclusiveLock (Requested locks 1)
745064347311734 [Pid 327578] Lock ungranted (local) 1214 (pg_catalog.pg_shdepend) RowExclusiveLock (Hold local 0)
745064347336007 [Pid 327578] Table open 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064347353183 [Pid 327578] Lock object 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064347376890 [Pid 327578] Lock granted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064347396366 [Pid 327578] Lock granted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Already hold local 0)
745064347413477 [Pid 327578] Lock was acquired in 60294 ns
745064347438596 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064347462497 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064347481886 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064347498752 [Pid 327578] Lock was acquired in 60156 ns
745064347638679 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064347658780 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064347687516 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064347711680 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064347730837 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Already hold local 0)
745064347749468 [Pid 327578] Lock was acquired in 61952 ns
745064347836563 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock
745064347856592 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) AccessShareLock (Hold local 0)
745064347885124 [Pid 327578] Lock object 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064347909388 [Pid 327578] Lock granted (fastpath) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064347928524 [Pid 327578] Lock granted (local) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock (Already hold local 0)
745064347945405 [Pid 327578] Lock was acquired in 60281 ns
745064347971113 [Pid 327578] Lock object 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064347995140 [Pid 327578] Lock granted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064348014609 [Pid 327578] Lock granted (local) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock (Already hold local 0)
745064348102848 [Pid 327578] Lock was acquired in 131735 ns
745064359396329 [Pid 327578] Lock ungranted (fastpath) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock
745064359418584 [Pid 327578] Lock ungranted (local) 2673 (pg_catalog.pg_depend_depender_index) RowExclusiveLock (Hold local 0)
745064359442539 [Pid 327578] Lock ungranted (fastpath) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock
745064359461367 [Pid 327578] Lock ungranted (local) 2674 (pg_catalog.pg_depend_reference_index) RowExclusiveLock (Hold local 0)
745064359483081 [Pid 327578] Table close 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064359504077 [Pid 327578] Lock ungranted (fastpath) 2608 (pg_catalog.pg_depend) RowExclusiveLock
745064359522493 [Pid 327578] Lock ungranted (local) 2608 (pg_catalog.pg_depend) RowExclusiveLock (Hold local 0)
745064359548580 [Pid 327578] Table close 328332 (public.metrics) NoLock
745064359566541 [Pid 327578] Table close 1259 (pg_catalog.pg_class) RowExclusiveLock
745064359587367 [Pid 327578] Lock ungranted (fastpath) 1259 (pg_catalog.pg_class) RowExclusiveLock
745064359605717 [Pid 327578] Lock ungranted (local) 1259 (pg_catalog.pg_class) RowExclusiveLock (Hold local 0)
745064359651119 [Pid 327578] Table open 1259 (pg_catalog.pg_class) AccessShareLock
745064359667961 [Pid 327578] Lock object 1259 (pg_catalog.pg_class) AccessShareLock
745064359693375 [Pid 327578] Lock granted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064359714827 [Pid 327578] Lock granted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Already hold local 0)
745064359732703 [Pid 327578] Lock was acquired in 64742 ns
745064359755347 [Pid 327578] Lock object 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064359778100 [Pid 327578] Lock granted (fastpath) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064359796247 [Pid 327578] Lock granted (local) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock (Already hold local 0)
745064359812617 [Pid 327578] Lock was acquired in 57270 ns
745064359909910 [Pid 327578] Lock ungranted (fastpath) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064359929042 [Pid 327578] Lock ungranted (local) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock (Hold local 0)
745064359952201 [Pid 327578] Table close 1259 (pg_catalog.pg_class) AccessShareLock
745064359973399 [Pid 327578] Lock ungranted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064359991320 [Pid 327578] Lock ungranted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Hold local 0)
745064360036095 [Pid 327578] Table open 1249 (pg_catalog.pg_attribute) AccessShareLock
745064360052741 [Pid 327578] Lock object 1249 (pg_catalog.pg_attribute) AccessShareLock
745064360075910 [Pid 327578] Lock granted (fastpath) 1249 (pg_catalog.pg_attribute) AccessShareLock
745064360093944 [Pid 327578] Lock granted (local) 1249 (pg_catalog.pg_attribute) AccessShareLock (Already hold local 0)
745064360110225 [Pid 327578] Lock was acquired in 57484 ns
745064360132111 [Pid 327578] Lock object 2659 (pg_catalog.pg_attribute_relid_attnum_index) AccessShareLock
745064360154727 [Pid 327578] Lock granted (fastpath) 2659 (pg_catalog.pg_attribute_relid_attnum_index) AccessShareLock
745064360172921 [Pid 327578] Lock granted (local) 2659 (pg_catalog.pg_attribute_relid_attnum_index) AccessShareLock (Already hold local 0)
745064360189385 [Pid 327578] Lock was acquired in 57274 ns
745064360354543 [Pid 327578] Lock ungranted (fastpath) 2659 (pg_catalog.pg_attribute_relid_attnum_index) AccessShareLock
745064360373938 [Pid 327578] Lock ungranted (local) 2659 (pg_catalog.pg_attribute_relid_attnum_index) AccessShareLock (Hold local 0)
745064360396537 [Pid 327578] Table close 1249 (pg_catalog.pg_attribute) AccessShareLock
745064360417835 [Pid 327578] Lock ungranted (fastpath) 1249 (pg_catalog.pg_attribute) AccessShareLock
745064360436021 [Pid 327578] Lock ungranted (local) 1249 (pg_catalog.pg_attribute) AccessShareLock (Hold local 0)
745064360483980 [Pid 327578] Lock object 328332 (public.metrics) AccessExclusiveLock
745064360606079 [Pid 327578] Lock granted 328332 (public.metrics) AccessExclusiveLock (Requested locks 1)
745064360623446 [Pid 327578] Lock granted (local) 328332 (public.metrics) AccessExclusiveLock (Already hold local 0)
745064360649586 [Pid 327578] Lock was acquired in 165606 ns
745064360728965 [Pid 327578] Table open 328332 (public.metrics) AccessExclusiveLock
745064360745603 [Pid 327578] Lock object 328332 (public.metrics) AccessExclusiveLock
745064360766604 [Pid 327578] Lock granted (local) 328332 (public.metrics) AccessExclusiveLock (Already hold local 1)
745064360781540 [Pid 327578] Lock was acquired in 35937 ns
745064360803960 [Pid 327578] Table close 328332 (public.metrics) NoLock
745064360915669 [Pid 327578] Table open 1259 (pg_catalog.pg_class) AccessShareLock
745064360932430 [Pid 327578] Lock object 1259 (pg_catalog.pg_class) AccessShareLock
745064360955869 [Pid 327578] Lock granted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064360974141 [Pid 327578] Lock granted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Already hold local 0)
745064360990725 [Pid 327578] Lock was acquired in 58295 ns
745064361012714 [Pid 327578] Lock object 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064361035492 [Pid 327578] Lock granted (fastpath) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064361053701 [Pid 327578] Lock granted (local) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock (Already hold local 0)
745064361070112 [Pid 327578] Lock was acquired in 57398 ns
745064361163634 [Pid 327578] Lock ungranted (fastpath) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock
745064361182887 [Pid 327578] Lock ungranted (local) 2662 (pg_catalog.pg_class_oid_index) AccessShareLock (Hold local 0)
745064361206214 [Pid 327578] Table close 1259 (pg_catalog.pg_class) AccessShareLock
745064361227633 [Pid 327578] Lock ungranted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064361245881 [Pid 327578] Lock ungranted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Hold local 0)
745064361287525 [Pid 327578] Table open 1259 (pg_catalog.pg_class) AccessShareLock
745064361331732 [Pid 327578] Lock object 1259 (pg_catalog.pg_class) AccessShareLock
745064361356607 [Pid 327578] Lock granted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064361375138 [Pid 327578] Lock granted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Already hold local 0)
745064361391959 [Pid 327578] Lock was acquired in 60227 ns
745064361424521 [Pid 327578] Table close 1259 (pg_catalog.pg_class) AccessShareLock
745064361445624 [Pid 327578] Lock ungranted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064361463789 [Pid 327578] Lock ungranted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Hold local 0)
745064361535429 [Pid 327578] Table open 1259 (pg_catalog.pg_class) AccessShareLock
745064361552253 [Pid 327578] Lock object 1259 (pg_catalog.pg_class) AccessShareLock
745064361575061 [Pid 327578] Lock granted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064361593224 [Pid 327578] Lock granted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Already hold local 0)
745064361609584 [Pid 327578] Lock was acquired in 57331 ns
745064361631520 [Pid 327578] Lock object 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock
745064361654381 [Pid 327578] Lock granted (fastpath) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock
745064361672562 [Pid 327578] Lock granted (local) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock (Already hold local 0)
745064361688805 [Pid 327578] Lock was acquired in 57285 ns
745064361788882 [Pid 327578] Lock ungranted (fastpath) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock
745064361808199 [Pid 327578] Lock ungranted (local) 2663 (pg_catalog.pg_class_relname_nsp_index) AccessShareLock (Hold local 0)
745064361831553 [Pid 327578] Table close 1259 (pg_catalog.pg_class) AccessShareLock
745064361852740 [Pid 327578] Lock ungranted (fastpath) 1259 (pg_catalog.pg_class) AccessShareLock
745064361870841 [Pid 327578] Lock ungranted (local) 1259 (pg_catalog.pg_class) AccessShareLock (Hold local 0)
745064362332644 [Pid 327578] Transaction commit
745064368169138 [Pid 327578] Lock ungranted (local) 2615 (pg_catalog.pg_namespace) AccessShareLock (Hold local 2)
745064368193137 [Pid 327578] Lock ungranted (local) 328332 (public.metrics) AccessExclusiveLock (Hold local 2)
745064368236259 [Pid 327578] Lock ungranted 328332 (public.metrics) AccessExclusiveLock (Requested locks 1)
745064368260426 [Pid 327578] Lock ungranted 2615 (pg_catalog.pg_namespace) AccessShareLock (Requested locks 1)
745064368747863 [Pid 327578] Query done
```
</details>


Statistics

```
Lock statistics:
================

Locks per oid
+----------------------------------------------+----------+------------------------------+
|                  Lock Name                   | Requests | Total Lock Request Time (ns) |
+----------------------------------------------+----------+------------------------------+
|     pg_catalog.pg_depend_reference_index     |    20    |           1174663            |
|             pg_catalog.pg_depend             |    8     |            456525            |
|              pg_catalog.pg_type              |    5     |            282986            |
|     pg_catalog.pg_type_typname_nsp_index     |    4     |            229317            |
|         pg_catalog.pg_type_oid_index         |    4     |            300239            |
|             pg_catalog.pg_class              |    3     |            180540            |
|        pg_catalog.pg_class_oid_index         |    3     |            172549            |
|     pg_catalog.pg_depend_depender_index      |    3     |            171186            |
|    pg_catalog.pg_class_relname_nsp_index     |    2     |            114311            |
|           pg_catalog.pg_attribute            |    2     |            113041            |
|  pg_catalog.pg_attribute_relid_attnum_index  |    2     |            113299            |
|                public.metrics                |    2     |            223162            |
| pg_catalog.pg_class_tblspc_relfilenode_index |    1     |            56426             |
|  pg_catalog.pg_attribute_relid_attnam_index  |    1     |            57238             |
|            pg_catalog.pg_shdepend            |    1     |            65878             |
|    pg_catalog.pg_shdepend_reference_index    |    1     |            63127             |
+----------------------------------------------+----------+------------------------------+

Lock types
+---------------------+---------------------------+
|      Lock Type      | Number of requested locks |
+---------------------+---------------------------+
|   AccessShareLock   |             32            |
|   RowExclusiveLock  |             28            |
| AccessExclusiveLock |             2             |
+---------------------+---------------------------+
```

## Filter Trace Events
`pg_lock_tracer` traces per default all supported events. However, often only certain events are required for the analysis (e.g., _which tables are opened?_). The event tracing can be restricted to certain events using the `-t <EVENT1> <EVENT2>` parameter. The following events are currently supported:

| Event          | Description                                                                                          |
|----------------|------------------------------------------------------------------------------------------------------|
| `TRANSACTION`  | Transactions related events (e.g., `StartTransaction`, `CommitTransaction`, `DeadLockReport`)        |
| `QUERY`        | The executed queries (e.g., `exec_simple_query`)                                                     |
| `TABLE`        | Table open and close events (e.g., `table_open`, `table_openrv`, `table_close`)                      |
| `LOCK`         | Lock events (e.g., `LockRelationOid`, `UnlockRelationOid`, `GrantLock`, `FastPathGrantRelationLock`) |
| `INVALIDATION` | Processing of cache invalidation messages (e.g., `AcceptInvalidationMessages`)                       |
| `ERROR`        | Error related events (e.g., `bpf_errstart`)                                                          |

```
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_14_2_DEBUG/bin/postgres -p 2287921 -r 2287921:psql://jan@localhost/test2 --statistics -t TABLE
[...]
4111321097620311 [Pid 2290711] Table open (by range value) .metric_name_local AccessShareLock
4111321097626817 [Pid 2287921] Table close 343035 (public.metric_name_local) NoLock
4111321097722307 [Pid 2287921] Table open 3079 (pg_catalog.pg_extension) AccessShareLock
4111321097877109 [Pid 2287921] Table close 3079 (pg_catalog.pg_extension) AccessShareLock
4111321097904906 [Pid 2287921] Table open 3079 (pg_catalog.pg_extension) AccessShareLock
4111321098012011 [Pid 2287921] Table close 3079 (pg_catalog.pg_extension) AccessShareLock
4111321098049134 [Pid 2287921] Table open 343035 (public.metric_name_local) NoLock
4111321098072567 [Pid 2287921] Table close 343035 (public.metric_name_local) NoLock
4111321098089922 [Pid 2287921] Table open 343035 (public.metric_name_local) NoLock
4111321098116394 [Pid 2287921] Table close 343035 (public.metric_name_local) NoLock
4111321098350309 [Pid 2287921] Table open 343035 (public.metric_name_local) NoLock
4111321098484761 [Pid 2287921] Table close 343035 (public.metric_name_local) NoLock
4111321098795235 [Pid 2287921] Table open 343035 (public.metric_name_local) NoLock
4111321098931302 [Pid 2287921] Table close 343035 (public.metric_name_local) NoLock
```

## Stack Traces

It is sometimes necessary to determine where in the source code a particular lock is requested. For this purpose, the option `-s <Lock Event>` can be used. In addition to the traces, stack traces are now also shown.

For example, by specifying `-s LOCK` a stack trace is generated and shown on each lock event. The following example shows where the lock for `pg_catalog.pg_extension` was requested.

```
pg_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_14_2_DEBUG/bin/postgres -p 1051967 -r 1051967:sql://jan@localhost/test2 -s LOCK
[...]
1990162746005798 [Pid 1051967] Lock object 3079 (pg_catalog.pg_extension) AccessShareLock
	LockRelationOid+0x0 [postgres]
	table_open+0x1d [postgres]
	parse_analyze+0xed [postgres]
	pg_analyze_and_rewrite+0x49 [postgres]
	exec_simple_query+0x2db [postgres]
	PostgresMain+0x833 [postgres]
	ExitPostmaster+0x0 [postgres]
	BackendStartup+0x1b1 [postgres]
	ServerLoop+0x2d9 [postgres]
	PostmasterMain+0x1286 [postgres]
	startup_hacks+0x0 [postgres]
	__libc_start_main+0xea [libc-2.31.so]
	[unknown]
[...]
```

### Animated Lock Graphs
See the content of the [examples](examples/) directory for examples.

# pg_lw_lock_tracer

`pg_lw_lock_trace` allows to trace lightweight locks ([LWLocks](https://github.com/postgres/postgres/blob/c8e1ba736b2b9e8c98d37a5b77c4ed31baf94147/src/backend/storage/lmgr/lwlock.c)) in a PostgreSQL process via _Userland Statically Defined Tracing_ (USDT).

## 🧪 Usage Examples
```
# Trace the LW locks of the PID 1234
pg_lw_lock_tracer -p 1234

# Trace the LW locks of the PIDs 1234 and 5678
pg_lw_lock_tracer -p 1234 -p 5678

# Trace the LW locks of the PID 1234 and be verbose
pg_lw_lock_tracer -p 1234 -v

# Trace the LW locks of the PID 1234 and collect statistics
pg_lw_lock_tracer -p 1234 -v --statistics
```

## Example output

SQL Query: `insert into test values(2);`

CLI: `sudo pg_lw_lock_tracer -p 1698108 --statistics`

Tracer output:

```
2904552881615298 [Pid 1704367] Acquired lock LockFastPath (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552881673849 [Pid 1704367] Unlock LockFastPath
2904552881782910 [Pid 1704367] Acquired lock ProcArray (mode LW_SHARED) / LWLockAcquire()
2904552881803614 [Pid 1704367] Unlock ProcArray
2904552881865272 [Pid 1704367] Acquired lock LockFastPath (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552881883641 [Pid 1704367] Unlock LockFastPath
[...]
```

<details>
  <summary>Full Output</summary>

```
===> Ready to trace
2904552881615298 [Pid 1704367] Acquired lock LockFastPath (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552881673849 [Pid 1704367] Unlock LockFastPath
2904552881782910 [Pid 1704367] Acquired lock ProcArray (mode LW_SHARED) / LWLockAcquire()
2904552881803614 [Pid 1704367] Unlock ProcArray
2904552881865272 [Pid 1704367] Acquired lock LockFastPath (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552881883641 [Pid 1704367] Unlock LockFastPath
2904552882095131 [Pid 1704367] Acquired lock ProcArray (mode LW_SHARED) / LWLockAcquire()
2904552882114171 [Pid 1704367] Unlock ProcArray
2904552882225372 [Pid 1704367] Acquired lock XidGen (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552882246673 [Pid 1704367] Unlock XidGen
2904552882270279 [Pid 1704367] Acquired lock LockManager (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552882296782 [Pid 1704367] Unlock LockManager
2904552882335466 [Pid 1704367] Acquired lock BufferMapping (mode LW_SHARED) / LWLockAcquire()
2904552882358198 [Pid 1704367] Unlock BufferMapping
2904552882379951 [Pid 1704367] Acquired lock BufferContent (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552882415333 [Pid 1704367] Acquired lock WALInsert (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552882485459 [Pid 1704367] Unlock WALInsert
2904552882506167 [Pid 1704367] Unlock BufferContent
2904552882590752 [Pid 1704367] Acquired lock WALInsert (mode LW_EXCLUSIVE) / LWLockAcquire()
2904552882611656 [Pid 1704367] Unlock WALInsert
2904552882638194 [Pid 1704367] Wait for WALWrite
2904554401202251 [Pid 1704367] Wait for WALWrite lock took 1518564057 ns
2904554401222926 [Pid 1704367] Waited but not acquired WALWrite (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554401234504 [Pid 1704367] Acquired lock WALWrite (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554404873664 [Pid 1704367] Unlock WALWrite
2904554404928035 [Pid 1704367] Acquired lock XactSLRU (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554404950334 [Pid 1704367] Unlock XactSLRU
2904554404972224 [Pid 1704367] Acquired lock ProcArray (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554404993887 [Pid 1704367] Unlock ProcArray
2904554405022734 [Pid 1704367] Acquired lock LockFastPath (mode LW_EXCLUSIVE) / LWLockAcquire()
2904554405038888 [Pid 1704367] Unlock LockFastPath
2904554405059788 [Pid 1704367] Acquired lock LockFastPath (mode LW_EXCLUSIVE) / LWLockAcquire()
2904554405088143 [Pid 1704367] Unlock LockFastPath
2904554405106194 [Pid 1704367] Acquired lock LockManager (mode LW_EXCLUSIVE) / LWLockAcquire()
2904554405145780 [Pid 1704367] Unlock LockManager
2904554405622791 [Pid 1704367] Acquired lock PgStatsData (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554405640885 [Pid 1704367] Unlock PgStatsData
2904554405665146 [Pid 1704367] Acquired lock PgStatsData (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554405682599 [Pid 1704367] Unlock PgStatsData
2904554405704514 [Pid 1704367] Acquired lock PgStatsData (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554405720734 [Pid 1704367] Unlock PgStatsData
2904554405737937 [Pid 1704367] Acquired lock PgStatsData (mode LW_EXCLUSIVE) / LWLockConditionalAcquire()
2904554405755387 [Pid 1704367] Unlock PgStatsData
```
</details>

Statistics

```
Lock statistics:
================

Locks per tranche
+---------------+----------+--------------------------+------------------------+-------------------------------+-----------------------------+-------+----------------+
|    Tranche    | Acquired | AcquireOrWait (Acquired) | AcquireOrWait (Waited) | ConditionalAcquire (Acquired) | ConditionalAcquire (Failed) | Waits | Wait time (ns) |
+---------------+----------+--------------------------+------------------------+-------------------------------+-----------------------------+-------+----------------+
| BufferContent |    1     |            0             |           0            |               0               |              0              |   0   |       0        |
| BufferMapping |    1     |            0             |           0            |               0               |              0              |   0   |       0        |
|  LockFastPath |    4     |            0             |           0            |               0               |              0              |   0   |       0        |
|  LockManager  |    2     |            0             |           0            |               0               |              0              |   0   |       0        |
|  PgStatsData  |    0     |            0             |           0            |               4               |              0              |   0   |       0        |
|   ProcArray   |    2     |            0             |           0            |               1               |              0              |   0   |       0        |
|   WALInsert   |    2     |            0             |           0            |               0               |              0              |   0   |       0        |
|    WALWrite   |    0     |            1             |           1            |               0               |              0              |   1   |   1518564057   |
|    XactSLRU   |    0     |            0             |           0            |               1               |              0              |   0   |       0        |
|     XidGen    |    1     |            0             |           0            |               0               |              0              |   0   |       0        |
+---------------+----------+--------------------------+------------------------+-------------------------------+-----------------------------+-------+----------------+

Locks per type
+--------------+----------+
|  Lock type   | Requests |
+--------------+----------+
| LW_EXCLUSIVE |    18    |
|  LW_SHARED   |    3     |
+--------------+----------+
```

# pg_row_lock_tracer

`pg_row_lock_tracer` allows to trace row locks (see the PostgreSQL [documentation](https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-ROWS)) of a PostgreSQL process using _eBPF_ and _UProbes_

## 🧪 Usage Examples
```
# Trace the row locks of the given PostgreSQL binary
pg_row_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_14_9_DEBUG/bin/postgres

# Trace the row locks of the PID 1234
pg_row_lock_tracer -p 1234 -x /home/jan/postgresql-sandbox/bin/REL_14_9_DEBUG/bin/postgres

# Trace the row locks of the PID 1234 and 5678
pg_row_lock_tracer -p 1234 -p 5678 -x /home/jan/postgresql-sandbox/bin/REL_14_9_DEBUG/bin/postgres

# Trace the row locks of the PID 1234 and be verbose
pg_row_lock_tracer -p 1234 -x /home/jan/postgresql-sandbox/bin/REL_14_9_DEBUG/bin/postgres -v

# Trace the row locks and show statistics
pg_row_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_14_9_DEBUG/bin/postgres --statistics
```

## Example output

SQL Query: `SELECT * FROM temperature FOR UPDATE;`

CLI: `sudo pg_row_lock_tracer -x /home/jan/postgresql-sandbox/bin/REL_14_9_DEBUG/bin/postgres --statistics`


Tracer output:

```
[...]
2783502701862408 [Pid 2604491] LOCK_TUPLE_END TM_OK in 13100 ns
2783502701877081 [Pid 2604491] LOCK_TUPLE (Tablespace 1663 database 305234 relation 313419) - (Block and offset 7 143) - LOCK_TUPLE_EXCLUSIVE LOCK_WAIT_BLOCK
2783502701972367 [Pid 2604491] LOCK_TUPLE_END TM_OK in 95286 ns
2783502701988387 [Pid 2604491] LOCK_TUPLE (Tablespace 1663 database 305234 relation 313419) - (Block and offset 7 144) - LOCK_TUPLE_EXCLUSIVE LOCK_WAIT_BLOCK
2783502702001690 [Pid 2604491] LOCK_TUPLE_END TM_OK in 13303 ns
2783502702016387 [Pid 2604491] LOCK_TUPLE (Tablespace 1663 database 305234 relation 313419) - (Block and offset 7 145) - LOCK_TUPLE_EXCLUSIVE LOCK_WAIT_BLOCK
2783502702029375 [Pid 2604491] LOCK_TUPLE_END TM_OK in 12988 ns
^C
Lock statistics:
================

Used wait policies:
+---------+-----------------+----------------+-----------------+
|   PID   | LOCK_WAIT_BLOCK | LOCK_WAIT_SKIP | LOCK_WAIT_ERROR |
+---------+-----------------+----------------+-----------------+
| 2604491 |       1440      |       0        |        0        |
+---------+-----------------+----------------+-----------------+

Lock modes:
+---------+---------------------+------------------+---------------------------+----------------------+
|   PID   | LOCK_TUPLE_KEYSHARE | LOCK_TUPLE_SHARE | LOCK_TUPLE_NOKEYEXCLUSIVE | LOCK_TUPLE_EXCLUSIVE |
+---------+---------------------+------------------+---------------------------+----------------------+
| 2604491 |          0          |        0         |             0             |         1440         |
+---------+---------------------+------------------+---------------------------+----------------------+

Lock results:
+---------+-------+--------------+-----------------+------------+------------+------------------+---------------+
|   PID   | TM_OK | TM_INVISIBLE | TM_SELFMODIFIED | TM_UPDATED | TM_DELETED | TM_BEINGMODIFIED | TM_WOULDBLOCK |
+---------+-------+--------------+-----------------+------------+------------+------------------+---------------+
| 2604491 |  1440 |      0       |        0        |     0      |     0      |        0         |       0       |
+---------+-------+--------------+-----------------+------------+------------+------------------+---------------+
```

# pg_spinlock_delay_tracer
`pg_spinlock_delay_tracer` allows tracing spinlock delays in a PostgreSQL process. Spin locks are used in PostgreSQL to protect short critical sections in the code. If another process already holds a spinlock, the requesting process will repeatedly check (i.e., "spin") until the lock becomes available. If the lock is held for a longer period, PostgreSQL performs a ["spin delay"](https://github.com/postgres/postgres/blob/0c8e082fba8d36434552d3d7800abda54acafd57/src/backend/storage/lmgr/s_lock.c#L106) and yields the CPU for a short time to avoid busy-waiting. Such delays are reported via the `pg_spinlock_delay_tracer`. For each delay, it prints the content of the `SpinDelayStatus` structure, which contains information about the number of spins, delays, and the current delay time. Additionally, the function name and source code location where the spin delay occurred are reported.

## 🧪 Usage Examples
```
# Trace the spinlock delays of the given PostgreSQL binary
pg_spinlock_delay_tracer -x /home/jan/postgresql-sandbox/bin/REL_17_1_DEBUG/bin/postgres

# Trace the spinlock delays of the PID 1234
pg_spinlock_delay_tracer -p 1234 -x /home/jan/postgresql-sandbox/bin/REL_17_1_DEBUG/bin/postgres
```

## Example output
To reproduce a spinlock delay, follow these steps to simulate a delay at the WAL insert position. First, start two different sessions connected to the same database. Then, create two tables:

```sql
CREATE TABLE mydata1 (id INT);
CREATE TABLE mydata2 (id INT);
```

Next, open a debugger and set a breakpoint in the function `ReserveXLogInsertLocation` after the spin lock `SpinLockAcquire(&Insert->insertpos_lck);` is acquired. Afterward, start the `pg_spinlock_delay_tracer` and perform two inserts in the two different sessions:

```
# Session 1
INSERT INTO mydata1 VALUES(1);
# Session 2
INSERT INTO mydata2 VALUES(2);
```

Note: Two different tables are used to prevent both sessions from trying to lock the same buffer and waiting for each other on a different lock.

The debugger should stop in the first session at the breakpoint. Furthermore, the pg_spinlock_delay_tracer should report spinlock delays in the second session, as the first session holds the spinlock for a longer period.

```
pg_spinlock_delay_tracer -x /home/jan/postgresql-sandbox/bin/REL_17_1_DEBUG/bin/postgres
[...]
13180680737869452 [Pid 1864403] SpinDelay spins=996 delays=939 cur_delay=566086 at ReserveXLogInsertLocation, xlog.c:1132
13180680737874986 [Pid 1864403] SpinDelay spins=997 delays=939 cur_delay=566086 at ReserveXLogInsertLocation, xlog.c:1132
13180680737880522 [Pid 1864403] SpinDelay spins=998 delays=939 cur_delay=566086 at ReserveXLogInsertLocation, xlog.c:1132
13180680737886009 [Pid 1864403] SpinDelay spins=999 delays=939 cur_delay=566086 at ReserveXLogInsertLocation, xlog.c:1132
13180681304189362 [Pid 1864403] SpinDelay spins=0 delays=940 cur_delay=661655 at ReserveXLogInsertLocation, xlog.c:1132
13180681304227806 [Pid 1864403] SpinDelay spins=1 delays=940 cur_delay=661655 at ReserveXLogInsertLocation, xlog.c:1132
13180681304241759 [Pid 1864403] SpinDelay spins=2 delays=940 cur_delay=661655 at ReserveXLogInsertLocation, xlog.c:1132
13180681304255150 [Pid 1864403] SpinDelay spins=3 delays=940 cur_delay=661655 at ReserveXLogInsertLocation, xlog.c:1132
[...]
```

# Additional Information

## Installation

The PostgreSQL lock tracing tools are available as a Python package. These tools depend on the Python package for BPF. Unfortunately, this package is currently not available via `pip` (the Python package manager). Therefore, the package of the Linux distribution needs to be installed to provide this dependency. On Debian and Ubuntu, this can be done by executing the following command:

```shell
apt install python3-bpfcc
```

The tracing tools can be installed system-wide or in a dedicated [virtual environment](https://docs.python.org/3/library/venv.html). To create and install the tools in such a virtual environment, the following steps must be performed. To install the tools system-wide, these steps can be skipped.

```shell
cd <installation directory>
python3 -m venv .venv
source .venv/bin/activate

# Copy the distribution Python BCC packages into this environment
cp -av /usr/lib/python3/dist-packages/bcc* $(python -c "import sysconfig; print(sysconfig.get_path('platlib'))")
```

Now, the tracing tools can be installed directly via `pip` by executing:

```shell
pip install pg-lock-tracer
```

The tools are now installed and can be invoked by calling `pg_lock_tracer` or `pg_lw_lock_tracer`.

If you want to install the latest development snapshot and development dependencies of the tools, the following commands need to be executed:

```shell
pip install -r requirements_dev.txt
pip install git+https://github.com/jnidzwetzki/pg-lock-tracer
```

## PostgreSQL Build
The software is tested with PostgreSQL versions 14, 15, 16, 17, and 18. In order to be able to attach the _uprobes_ to the functions, they should not to be optimized away (e.g., inlined) during the compilation of PostgreSQL. Otherwise errors like `Unable to locate function XXX` will occur when `pg_lock_tracer` is started.

It is recommended to compile PostgreSQL with the following CFLAGS: `CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"`. 

`pg_lw_lock_trace` uses [USDT probes](https://www.postgresql.org/docs/current/dynamic-trace.html). Therefore, PostgreSQL has to be compiled with `--enable-dtrace` to use this script. 


================================================
FILE: examples/create_table_trace.html
================================================

<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="https://d3js.org/d3.v7.js"></script>
<script src="https://unpkg.com/@hpcc-js/wasm@2/dist/graphviz.umd.js"></script>
<script src="https://unpkg.com/d3-graphviz@5/build/d3-graphviz.js"></script>

<style>
.frame_div {
   display: inline-block;
}

#frame_control {
   background-color: lightgray;
   height: 24px;
   margin-bottom: 5px;
   padding-left: 5px;
}

#pause_control {
   padding-left: 20px;
}

input, output {
  vertical-align: middle;
}
</style>
<div id="frame_control">
  Frame <input type="range" id="active_frame_slider" min="0" max="100" value="0" oninput="updateSlider(this.value);" onchange="render();">
  <div id="frames" class="frame_div">
     (<div id="cur_frame" class="frame_div"></div> of <div id="total_frame" class="frame_div"></div>)
  </div>
  <div id="pause_control" class="frame_div">
    <input type="checkbox" id="render_active" name="render_active" value="active" checked onclick="render();">
     <label for="render_active" style="vertical-align: bottom;">&#9658; Play</label>
    </input>
  </div>
</div>

<div id="graph" style="text-align: center;"></div>

<script>
var dotIndex = 0;

var graphviz = d3.select("#graph").graphviz()
    .attributer(attributer)
    .transition(function () {
        return d3.transition("main")
            .ease(d3.easeLinear)
            .delay(500)
            .duration(1500);
    })
    .logEvents(true)
    .engine('circo')
    .on("initEnd", render);

function render() {
    var dotLines = dots[dotIndex];
    var dot = dotLines.join('');
    graphviz
        .renderDot(dot)
        .on("end", function () {
            if (! document.getElementById('render_active').checked) {
                return;
            }
            dotIndex = (dotIndex + 1) % dots.length;
            updateFrames();
            document.getElementById("active_frame_slider").value = dotIndex;
            render();
        })
        .zoom(true);
}

function updateFrames() {
    document.getElementById("cur_frame").innerHTML = dotIndex;
    document.getElementById("total_frame").innerHTML = dots.length;
}

function updateSlider(newValue) {
    dotIndex = Number(newValue);
    updateFrames();
}

function initSlider() {
    document.getElementById("active_frame_slider").value = dotIndex;
    document.getElementById("active_frame_slider").max = dots.length;
}

function attributer(datum, index, nodes) {
    marginWidth = 20; // to avoid scrollbars
    marginHeight = 40;
    var selection = d3.select(this);
    if (datum.tag == "svg") {
        var width = window.innerWidth;
        var height = window.innerHeight;
        datum.attributes.width = width - marginWidth;
        datum.attributes.height = height - marginHeight;
    }
}


var dots = [
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_class" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_relname_nsp_index" [label="pg_catalog.pg_class_relname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_class" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class_relname_nsp_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_class" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_typname_nsp_index" [label="pg_catalog.pg_type_typname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_type_typname_nsp_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_oid_index" [label="pg_catalog.pg_class_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_oid_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_oid_index" [label="pg_catalog.pg_type_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_type_oid_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_oid_index" [label="pg_catalog.pg_type_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_oid_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_oid_index" [label="pg_catalog.pg_type_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_oid_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_oid_index" [label="pg_catalog.pg_type_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_typname_nsp_index" [label="pg_catalog.pg_type_typname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_oid_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_typname_nsp_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_typname_nsp_index" [label="pg_catalog.pg_type_typname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_typname_nsp_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_depender_index" [label="pg_catalog.pg_depend_\ndepender_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_depender_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_depender_index" [label="pg_catalog.pg_depend_\ndepender_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_depender_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_typname_nsp_index" [label="pg_catalog.pg_type_typname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_type_typname_nsp_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_oid_index" [label="pg_catalog.pg_type_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_oid_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_oid_index" [label="pg_catalog.pg_type_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_typname_nsp_index" [label="pg_catalog.pg_type_typname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_oid_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_typname_nsp_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type_typname_nsp_index" [label="pg_catalog.pg_type_typname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type_typname_nsp_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_depender_index" [label="pg_catalog.pg_depend_\ndepender_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_depender_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_depender_index" [label="pg_catalog.pg_depend_\ndepender_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_depender_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_type" [label="pg_catalog.pg_type" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_type" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_oid_index" [label="pg_catalog.pg_class_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_oid_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_oid_index" [label="pg_catalog.pg_class_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_relname_nsp_index" [label="pg_catalog.pg_class_relname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_oid_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_relname_nsp_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_oid_index" [label="pg_catalog.pg_class_oid_\nindex" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_relname_nsp_index" [label="pg_catalog.pg_class_relname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_tblspc_relfilenode_index" [label="pg_catalog.pg_class_tblspc_\nrelfilenode_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_oid_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_relname_nsp_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_tblspc_relfilenode_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_relname_nsp_index" [label="pg_catalog.pg_class_relname_\nnsp_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_tblspc_relfilenode_index" [label="pg_catalog.pg_class_tblspc_\nrelfilenode_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_relname_nsp_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_tblspc_relfilenode_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class_tblspc_relfilenode_index" [label="pg_catalog.pg_class_tblspc_\nrelfilenode_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_class_tblspc_relfilenode_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=0.75]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnam_index" [label="pg_catalog.pg_attribute_\nrelid_attnam_index" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnam_index" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute_relid_attnum_index" [label="pg_catalog.pg_attribute_\nrelid_attnum_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute_relid_attnum_index" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_attribute" [label="pg_catalog.pg_attribute" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_attribute" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_shdepend" [label="pg_catalog.pg_shdepend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_shdepend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_shdepend" [label="pg_catalog.pg_shdepend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_shdepend_reference_index" [label="pg_catalog.pg_shdepend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_shdepend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_shdepend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_shdepend" [label="pg_catalog.pg_shdepend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_shdepend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend_reference_index" [label="pg_catalog.pg_depend_\nreference_index" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend_reference_index" [label=AccessShareLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.7]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_class" [label="pg_catalog.pg_class" fillcolor=lightgray shape=box style=filled]',
'	"pg_catalog.pg_depend" [label="pg_catalog.pg_depend" fillcolor=lightgray shape=box style=filled]',
'	query_328192 -> "pg_catalog.pg_namespace" [label=AccessShareLock]',
'	query_328192 -> "pg_catalog.pg_class" [label=RowExclusiveLock]',
'	query_328192 -> "pg_catalog.pg_depend" [label=RowExclusiveLock]',
'}'],
['digraph "lock-graph" {',
'	graph [mindist=1.0]',
'	query_328192 [label="create table metrics(ts timestamptz NOT NULL, id int NOT NULL, value float);" fillcolor=gray style=filled]',
'	"pg_catalog.pg_namespace" [label="pg_catalog.pg_namespace"
Download .txt
gitextract_x8d44rn2/

├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── codeql.yml
│       ├── integration_tests.yml
│       ├── pr_handling.yml
│       ├── python_publish.yml
│       ├── stale.yml
│       └── tests.yml
├── .gitignore
├── LICENSE
├── README.md
├── examples/
│   ├── create_table_trace.html
│   └── create_table_trace.json
├── pylintrc
├── pyproject.toml
├── requirements_dev.txt
├── src/
│   └── pg_lock_tracer/
│       ├── __init__.py
│       ├── animate_lock_graph.py
│       ├── bpf/
│       │   ├── .clang-format
│       │   ├── __init__.py
│       │   ├── pg_lock_tracer.c
│       │   ├── pg_lw_lock_tracer.c
│       │   ├── pg_row_lock_tracer.c
│       │   └── pg_spinlock_delay_tracer.c
│       ├── helper.py
│       ├── oid_resolver.py
│       ├── pg_lock_tracer.py
│       ├── pg_lw_lock_tracer.py
│       ├── pg_row_lock_tracer.py
│       └── pg_spinlock_delay_tracer.py
└── tests/
    ├── __init__.py
    └── test_helper.py
Download .txt
SYMBOL INDEX (172 symbols across 12 files)

FILE: src/pg_lock_tracer/animate_lock_graph.py
  class DOTModel (line 178) | class DOTModel:
    method __init__ (line 179) | def __init__(self, input_file, verbose) -> None:
    method calculate_graphs (line 186) | def calculate_graphs(self):
    method handle_json (line 195) | def handle_json(self, event):
    method generate_graph (line 282) | def generate_graph(self):
    method get_html (line 354) | def get_html(self):
  class StringHelper (line 366) | class StringHelper:
    method split_string (line 368) | def split_string(mystring, max_length):
    method get_tablename (line 387) | def get_tablename(event):
  function main (line 397) | def main():

FILE: src/pg_lock_tracer/bpf/pg_lock_tracer.c
  type PostgreSQLEvent (line 12) | struct PostgreSQLEvent {
  function fill_basic_data (line 36) | static void fill_basic_data(PostgreSQLEvent *event) {
  function handle_table_event (line 47) | static void handle_table_event(PostgreSQLEvent *event, struct pt_regs *c...
  function bpf_table_open (line 63) | int bpf_table_open(struct pt_regs *ctx) {
  type RangeVar (line 81) | typedef struct RangeVar {
  function bpf_table_openrv (line 93) | int bpf_table_openrv(struct pt_regs *ctx, RangeVar *relation) {
  function bpf_table_openrv_extended (line 112) | int bpf_table_openrv_extended(struct pt_regs *ctx, RangeVar *relation) {
  function bpf_table_close (line 125) | int bpf_table_close(struct pt_regs *ctx) {
  function fill_basic_data_and_submit (line 167) | static void fill_basic_data_and_submit(PostgreSQLEvent *event,
  function bpf_query_begin (line 178) | int bpf_query_begin(struct pt_regs *ctx) {
  function bpf_query_end (line 189) | int bpf_query_end(struct pt_regs *ctx) {
  function bpf_errstart (line 200) | int bpf_errstart(struct pt_regs *ctx) {
  function bpf_lock_relation_oid (line 224) | int bpf_lock_relation_oid(struct pt_regs *ctx) {
  function bpf_lock_relation_oid_end (line 240) | int bpf_lock_relation_oid_end(struct pt_regs *ctx) {
  function bpf_unlock_relation_oid (line 251) | int bpf_unlock_relation_oid(struct pt_regs *ctx) {
  function fill_lock_object (line 286) | static void fill_lock_object(PostgreSQLEvent *event, void *param) {
  function bpf_lock_grant (line 300) | int bpf_lock_grant(struct pt_regs *ctx) {
  function bpf_lock_fastpath_grant (line 316) | int bpf_lock_fastpath_grant(struct pt_regs *ctx) {
  function fill_locallock_object (line 352) | static void fill_locallock_object(PostgreSQLEvent *event, void *param) {
  function bpf_lock_local_grant (line 366) | int bpf_lock_local_grant(struct pt_regs *ctx) {
  function bpf_lock_ungrant (line 380) | int bpf_lock_ungrant(struct pt_regs *ctx) {
  function bpf_lock_fastpath_ungrant (line 400) | int bpf_lock_fastpath_ungrant(struct pt_regs *ctx) {
  function bfp_local_lock_ungrant (line 420) | int bfp_local_lock_ungrant(struct pt_regs *ctx) {
  function bpf_deadlock (line 433) | int bpf_deadlock(struct pt_regs *ctx) {
  function bpf_transaction_begin (line 451) | int bpf_transaction_begin(struct pt_regs *ctx) {
  function bpf_transaction_commit (line 460) | int bpf_transaction_commit(struct pt_regs *ctx) {
  function bpf_transaction_abort (line 469) | int bpf_transaction_abort(struct pt_regs *ctx) {
  function bpf_accept_invalidation_messages (line 484) | int bpf_accept_invalidation_messages(struct pt_regs *ctx) {

FILE: src/pg_lock_tracer/bpf/pg_lw_lock_tracer.c
  type LWLockMode (line 3) | typedef enum LWLockMode {
  type LockEvent_t (line 14) | struct LockEvent_t {
  function fill_and_submit (line 29) | static void fill_and_submit(struct pt_regs *ctx, LockEvent *event,
  function lwlock_acquire (line 46) | int lwlock_acquire(struct pt_regs *ctx) {
  function lwlock_release (line 67) | int lwlock_release(struct pt_regs *ctx) {
  function lwlock_wait_start (line 82) | int lwlock_wait_start(struct pt_regs *ctx) {
  function lwlock_wait_done (line 103) | int lwlock_wait_done(struct pt_regs *ctx) {
  function lwlock_condacquire (line 122) | int lwlock_condacquire(struct pt_regs *ctx) {
  function lwlock_condacquire_fail (line 141) | int lwlock_condacquire_fail(struct pt_regs *ctx) {
  function lwlock_acquire_or_wait (line 160) | int lwlock_acquire_or_wait(struct pt_regs *ctx) {
  function lwlock_acquire_or_wait_fail (line 179) | int lwlock_acquire_or_wait_fail(struct pt_regs *ctx) {

FILE: src/pg_lock_tracer/bpf/pg_row_lock_tracer.c
  type RowLockEvent_t (line 6) | struct RowLockEvent_t {
  function fill_and_submit (line 32) | static void fill_and_submit(struct pt_regs *ctx, RowLockEvent *event) {
  function heapam_tuple_lock (line 57) | int heapam_tuple_lock(struct pt_regs *ctx) {
  function heapam_tuple_lock_end (line 114) | int heapam_tuple_lock_end(struct pt_regs *ctx) {

FILE: src/pg_lock_tracer/bpf/pg_spinlock_delay_tracer.c
  type SpinDelayStatus (line 5) | typedef struct SpinDelayStatus_t {
  type SpinDelayEvent (line 14) | typedef struct SpinDelayEvent_t {
  function spin_delay (line 27) | int spin_delay(struct pt_regs *ctx) {

FILE: src/pg_lock_tracer/helper.py
  class PostgreSQLLockHelper (line 12) | class PostgreSQLLockHelper:
    method encode_locks_into_value (line 44) | def encode_locks_into_value(locks):
    method decode_locks_from_value (line 57) | def decode_locks_from_value(encoded_value):
    method lock_type_to_str (line 72) | def lock_type_to_str(lock_type):
    method lock_type_to_int (line 83) | def lock_type_to_int(lock_name):
  class BPFHelper (line 94) | class BPFHelper:
    method enum_to_defines (line 99) | def enum_to_defines(enum_instance, prefix):
    method read_bpf_program (line 111) | def read_bpf_program(program_name):
    method check_pid_exe (line 124) | def check_pid_exe(pids, executable):
    method register_ebpf_probe (line 145) | def register_ebpf_probe(

FILE: src/pg_lock_tracer/oid_resolver.py
  class OIDResolver (line 10) | class OIDResolver:
    method __init__ (line 11) | def __init__(self, connection_url):
    method connect (line 18) | def connect(self):
    method disconnect (line 47) | def disconnect(self):
    method fetch_all_oids (line 59) | def fetch_all_oids(self):
    method fetch_oid_from_db (line 86) | def fetch_oid_from_db(self, oid):
    method resolve_oid (line 126) | def resolve_oid(self, oid):

FILE: src/pg_lock_tracer/pg_lock_tracer.py
  class TraceEvents (line 61) | class TraceEvents(IntEnum):
  class Events (line 159) | class Events(IntEnum):
  class PGError (line 187) | class PGError(IntEnum):
  class LockStatisticsEntry (line 193) | class LockStatisticsEntry:
    method __init__ (line 194) | def __init__(self) -> None:
    method lock_count (line 205) | def lock_count(self):
    method lock_count (line 209) | def lock_count(self, value):
    method lock_time_ns (line 213) | def lock_time_ns(self):
    method lock_time_ns (line 217) | def lock_time_ns(self, value):
    method requested_locks (line 221) | def requested_locks(self):
    method requested_locks (line 225) | def requested_locks(self, lock_type):
  class PGLockTraceOutput (line 229) | class PGLockTraceOutput(ABC):
    method __init__ (line 230) | def __init__(self) -> None:
    method set_context (line 242) | def set_context(
    method print_event (line 254) | def print_event(self, _cpu, data, _size):
    method update_statistics (line 260) | def update_statistics(self, event, oid_value):
    method get_lock_wait_time (line 281) | def get_lock_wait_time(self, event):
    method print_statistics (line 293) | def print_statistics(self):
    method handle_output_line (line 336) | def handle_output_line(self, line):
  class PGLockTraceOutputHuman (line 346) | class PGLockTraceOutputHuman(PGLockTraceOutput):
    method print_event (line 348) | def print_event(self, _cpu, data, _size):
    method print_stacktace_if_available (line 455) | def print_stacktace_if_available(self, event):
  class PGLockTraceOutputJSON (line 477) | class PGLockTraceOutputJSON(PGLockTraceOutput):
    method print_event (line 478) | def print_event(self, _cpu, data, _size):
    method add_stacktrace_if_available (line 545) | def add_stacktrace_if_available(self, output, event):
  class PGLockTracer (line 569) | class PGLockTracer:
    method __init__ (line 570) | def __init__(self, prog_args):
    method generate_c_defines (line 611) | def generate_c_defines(stacktrace_events, verbose):
    method init (line 639) | def init(self):
    method attach_probes (line 695) | def attach_probes(self):
    method run (line 866) | def run(self):
  function main (line 884) | def main():

FILE: src/pg_lock_tracer/pg_lw_lock_tracer.py
  class Events (line 69) | class Events(IntEnum):
  class LWLockMode (line 81) | class LWLockMode(IntEnum):
  class LockStatisticsEntry (line 87) | class LockStatisticsEntry:
    method __init__ (line 88) | def __init__(self) -> None:
    method direct_lock_count (line 114) | def direct_lock_count(self):
    method direct_lock_count (line 118) | def direct_lock_count(self, value):
    method acquire_or_wait_count (line 122) | def acquire_or_wait_count(self):
    method acquire_or_wait_count (line 126) | def acquire_or_wait_count(self, value):
    method acquire_or_wait_failed_count (line 130) | def acquire_or_wait_failed_count(self):
    method acquire_or_wait_failed_count (line 134) | def acquire_or_wait_failed_count(self, value):
    method wait_lock_count (line 138) | def wait_lock_count(self):
    method wait_lock_count (line 142) | def wait_lock_count(self, value):
    method lock_cond_count (line 146) | def lock_cond_count(self):
    method lock_cond_count (line 150) | def lock_cond_count(self, value):
    method lock_cond_failed_count (line 154) | def lock_cond_failed_count(self):
    method lock_cond_failed_count (line 158) | def lock_cond_failed_count(self, value):
    method lock_wait_time_ns (line 162) | def lock_wait_time_ns(self):
    method lock_wait_time_ns (line 166) | def lock_wait_time_ns(self, value):
    method requested_locks (line 170) | def requested_locks(self):
    method requested_locks (line 174) | def requested_locks(self, lock_type):
  class PGLWLockTracer (line 178) | class PGLWLockTracer:
    method __init__ (line 179) | def __init__(self, prog_args):
    method update_statistics (line 188) | def update_statistics(self, event, tranche, lock_mode):
    method get_lock_wait_time (line 240) | def get_lock_wait_time(self, event):
    method print_lock_event (line 250) | def print_lock_event(self, _cpu, data, _size):
    method init (line 300) | def init(self):
    method print_statistics (line 346) | def print_statistics(self):
    method run (line 402) | def run(self):
  function main (line 416) | def main():

FILE: src/pg_lock_tracer/pg_row_lock_tracer.py
  class Events (line 77) | class Events(IntEnum):
  class TMResult (line 84) | class TMResult(IntEnum):
  class LockWaitPolicy (line 96) | class LockWaitPolicy(IntEnum):
  class LockTupleMode (line 104) | class LockTupleMode(IntEnum):
  class LockStatisticsEntry (line 111) | class LockStatisticsEntry:
    method __init__ (line 112) | def __init__(self) -> None:
    method lock_modes (line 123) | def lock_modes(self):
    method lock_modes (line 127) | def lock_modes(self, value):
    method lock_policies (line 131) | def lock_policies(self):
    method lock_policies (line 135) | def lock_policies(self, value):
    method lock_results (line 139) | def lock_results(self):
    method lock_results (line 143) | def lock_results(self, value):
  class PGRowLockTracer (line 147) | class PGRowLockTracer:
    method __init__ (line 148) | def __init__(self, prog_args):
    method get_lock_wait_time (line 159) | def get_lock_wait_time(self, event):
    method update_statistics (line 169) | def update_statistics(self, event):
    method print_lock_event (line 208) | def print_lock_event(self, _cpu, data, _size):
    method init (line 240) | def init(self):
    method attach_probes (line 267) | def attach_probes(self):
    method print_statistics (line 287) | def print_statistics(self):
    method run (line 344) | def run(self):
  function main (line 358) | def main():

FILE: src/pg_lock_tracer/pg_spinlock_delay_tracer.py
  class PGSpinDelayTracer (line 67) | class PGSpinDelayTracer:
    method __init__ (line 68) | def __init__(self, prog_args):
    method _decode_field (line 76) | def _decode_field(value):
    method print_lock_event (line 79) | def print_lock_event(self, _cpu, data, _size):
    method init (line 97) | def init(self):
    method attach_probes (line 121) | def attach_probes(self):
    method run (line 133) | def run(self):
  function main (line 145) | def main():

FILE: tests/test_helper.py
  class UNITTests (line 8) | class UNITTests(unittest.TestCase):
    method test_encode_locks (line 9) | def test_encode_locks(self):
    method encode_and_decode_locks (line 25) | def encode_and_decode_locks(self, locks):
    method test_parse_lock_decoding_and_encoding0 (line 42) | def test_parse_lock_decoding_and_encoding0(self):
    method test_parse_lock_decoding_and_encoding1 (line 53) | def test_parse_lock_decoding_and_encoding1(self):
    method test_parse_lock_decoding_and_encoding2 (line 67) | def test_parse_lock_decoding_and_encoding2(self):
    method test_parse_lock_decoding_and_encoding3 (line 76) | def test_parse_lock_decoding_and_encoding3(self):
    method test_parse_lock_decoding_and_encoding_dup (line 85) | def test_parse_lock_decoding_and_encoding_dup(self):
Condensed preview — 31 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (434K chars).
[
  {
    "path": ".github/dependabot.yml",
    "chars": 672,
    "preview": "# To get started with Dependabot version updates, you'll need to specify which\n# package ecosystems to update and where "
  },
  {
    "path": ".github/workflows/codeql.yml",
    "chars": 2934,
    "preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
  },
  {
    "path": ".github/workflows/integration_tests.yml",
    "chars": 4462,
    "preview": "name: Basic Integration Tests\n\non:\n  pull_request:\n  push:\n    branches:\n      - main\n\njobs:\n  config:\n    strategy:\n   "
  },
  {
    "path": ".github/workflows/pr_handling.yml",
    "chars": 560,
    "preview": "name: PR Handling\n\n#################\n# NOTE: We are using pull_request_target here:\n#       https://docs.github.com/en/a"
  },
  {
    "path": ".github/workflows/python_publish.yml",
    "chars": 1583,
    "preview": "# Based on https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml\nname: Upload Python Package\n\non:"
  },
  {
    "path": ".github/workflows/stale.yml",
    "chars": 727,
    "preview": "name: 'Close stale issues'\n\"on\":\n  schedule:\n    - cron: '30 1 * * *'\n  workflow_dispatch:\n\njobs:\n  stale:\n    runs-on: "
  },
  {
    "path": ".github/workflows/tests.yml",
    "chars": 1500,
    "preview": "name: Basic Project Tests\non:\n  pull_request:\n  push:\n    branches:\n      - main\n\njobs:\n  tests:\n    name: Perform unit "
  },
  {
    "path": ".gitignore",
    "chars": 1817,
    "preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
  },
  {
    "path": "LICENSE",
    "chars": 11348,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 76348,
    "preview": "# Lock tracing tools for PostgreSQL\n[![Build Status](https://github.com/jnidzwetzki/pg-lock-tracer/actions/workflows/tes"
  },
  {
    "path": "examples/create_table_trace.html",
    "chars": 108036,
    "preview": "\n<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<body>\n<script src=\"https://d3js.org/d3.v7.js\"></script>\n<script src=\"https://un"
  },
  {
    "path": "examples/create_table_trace.json",
    "chars": 66154,
    "preview": "{\"timestamp\": 746704676283500, \"pid\": 328192, \"event\": \"QUERY_BEGIN\", \"query\": \"create table metrics(ts timestamptz NOT "
  },
  {
    "path": "pylintrc",
    "chars": 20896,
    "preview": "[MAIN]\n\n# Analyse import fallback blocks. This can be used to support both Python 2 and\n# 3 compatible code, which means"
  },
  {
    "path": "pyproject.toml",
    "chars": 1583,
    "preview": "[build-system]\nrequires = [\"setuptools>=59\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[project]\nname = \"pg_lock_tracer\"\n"
  },
  {
    "path": "requirements_dev.txt",
    "chars": 427,
    "preview": "astroid==4.0.3\nattrs==26.1.0\nblack==26.3.1\nclick==8.3.3\ndill==0.4.1\nexceptiongroup==1.3.1\ngraphviz==0.21\nigraph==1.0.0\ni"
  },
  {
    "path": "src/pg_lock_tracer/__init__.py",
    "chars": 22,
    "preview": "__version__ = \"0.7.1\"\n"
  },
  {
    "path": "src/pg_lock_tracer/animate_lock_graph.py",
    "chars": 12296,
    "preview": "#!/usr/bin/env python3\n#\n# Generate an animated version of the locks\n# of a query. Input data is the JSON output of\n# pg"
  },
  {
    "path": "src/pg_lock_tracer/bpf/.clang-format",
    "chars": 6098,
    "preview": "---\nLanguage:        Cpp\n# BasedOnStyle:  Google\nAccessModifierOffset: -1\nAlignAfterOpenBracket: Align\nAlignArrayOfStruc"
  },
  {
    "path": "src/pg_lock_tracer/bpf/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/pg_lock_tracer/bpf/pg_lock_tracer.c",
    "chars": 14003,
    "preview": "#include <uapi/linux/ptrace.h>\n\n/*\n * Placeholder for EVENT_* and ERROR_* defines\n *\n * #define EVENT_.... n\n *\n * Will "
  },
  {
    "path": "src/pg_lock_tracer/bpf/pg_lw_lock_tracer.c",
    "chars": 4916,
    "preview": "// https://github.com/postgres/postgres/blob/a4adc31f6902f6fc29d74868e8969412fc590da9/src/include/storage/lwlock.h#L110\n"
  },
  {
    "path": "src/pg_lock_tracer/bpf/pg_row_lock_tracer.c",
    "chars": 3342,
    "preview": "#include <uapi/linux/ptrace.h>\n\n/* Placeholder for auto generated defines */\n__DEFINES__\n\ntypedef struct RowLockEvent_t "
  },
  {
    "path": "src/pg_lock_tracer/bpf/pg_spinlock_delay_tracer.c",
    "chars": 1254,
    "preview": "#include <uapi/linux/ptrace.h>\n\n#define MAX_STR_LEN 128\n\ntypedef struct SpinDelayStatus_t {\n  int spins;\n  int delays;\n "
  },
  {
    "path": "src/pg_lock_tracer/helper.py",
    "chars": 5270,
    "preview": "\"\"\"\nHelper classes\n\"\"\"\n\nimport os\n\nfrom pathlib import Path\n\nfrom bcc import BPF\n\n\nclass PostgreSQLLockHelper:\n    \"\"\"\n "
  },
  {
    "path": "src/pg_lock_tracer/oid_resolver.py",
    "chars": 3591,
    "preview": "\"\"\"Resolve PostgreSQL OIDs to names and cache the result\"\"\"\n\nimport sys\n\nfrom urllib.parse import urlparse\n\nimport psyco"
  },
  {
    "path": "src/pg_lock_tracer/pg_lock_tracer.py",
    "chars": 30168,
    "preview": "#!/usr/bin/env python3\n#\n# PostgreSQL lock tracer\n#\n# This tool traces the lock operations that PostgreSQL performs.\n#\n#"
  },
  {
    "path": "src/pg_lock_tracer/pg_lw_lock_tracer.py",
    "chars": 13204,
    "preview": "#!/usr/bin/env python3\n#\n# PostgreSQL LW lock tracer. To use this script, PostgreSQL has to be\n# compiled with '--enable"
  },
  {
    "path": "src/pg_lock_tracer/pg_row_lock_tracer.py",
    "chars": 10405,
    "preview": "#!/usr/bin/env python3\n#\n# PostgreSQL row lock tracer.\n#\n# See https://www.postgresql.org/docs/current/explicit-locking."
  },
  {
    "path": "src/pg_lock_tracer/pg_spinlock_delay_tracer.py",
    "chars": 4227,
    "preview": "#!/usr/bin/env python3\n#\n# PostgreSQL spinlock delay tracer.\n#\n###############################################\n\nimport s"
  },
  {
    "path": "tests/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "tests/test_helper.py",
    "chars": 3117,
    "preview": "#!/usr/bin/env python3\n\nimport unittest\n\nfrom src.pg_lock_tracer.helper import PostgreSQLLockHelper\n\n\nclass UNITTests(un"
  }
]

About this extraction

This page contains the full source code of the jnidzwetzki/pg-lock-tracer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 31 files (401.3 KB), approximately 112.9k tokens, and a symbol index with 172 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!