Pigsty Blog Articles

Posts in 2019
  • Locks in PostgreSQL

    June 11, 2019 in PostgreSQL

    Locks in PostgreSQL

    Snapshot isolation does most of the heavy lifting in PG, but locks still matter. Here’s a practical guide to table locks, row locks, intention locks, and `pg_locks`.

    Read more

    Snapshot isolation does most of the heavy lifting in PG, but locks still matter. Here’s a practical guide to table locks, row locks, intention locks, and `pg_locks`.

    Read more

  • O(n2) Complexity of GIN Search

    April 12, 2019 in PostgreSQL

    O(n2) Complexity of GIN Search

    When GIN indexes are used to search with very long keyword lists, performance degrades significantly. This article explains why GIN index keyword search has O(n^2) time complexity.

    Read more

    When GIN indexes are used to search with very long keyword lists, performance degrades significantly. This article explains why GIN index keyword search has O(n^2) time complexity.

    Read more

  • PostgreSQL Common Replication Topology Plans

    March 29, 2019 in PostgreSQL

    PostgreSQL Common Replication Topology Plans

    Replication is one of the core issues in system architecture.

    Read more

    Replication is one of the core issues in system architecture.

    Read more

  • Warm Standby: Using pg_receivewal

    March 02, 2019 in PostgreSQL

    Warm Standby: Using pg_receivewal

    There are various backup strategies. Physical backups can usually be divided into four types.

    Read more

    There are various backup strategies. Physical backups can usually be divided into four types.

    Read more

  • Is running postgres in docker a good idea?

    January 13, 2019 in Database

    Is running postgres in docker a good idea?

    Thou shalt not run a prod database inside a container

    Read more

    Thou shalt not run a prod database inside a container

    Read more

Posts in 2018
  • Understanding Time - Leap Years, Leap Seconds, Time and Time Zones

    December 11, 2018 in Database

    Understanding Time - Leap Years, Leap Seconds, Time and Time Zones

    A proper understanding of time is very helpful for correctly handling time-related issues in work and life. For example, time representation and processing in computers, as well as time handling in databases and programming languages.

    Read more

    A proper understanding of time is very helpful for correctly handling time-related issues in work and life. For example, time representation and processing in computers, as well as time handling in databases and programming languages.

    Read more

  • Incident-Report: Connection-Pool Contamination Caused by pg_dump

    December 11, 2018 in PostgreSQL

    Incident-Report: Connection-Pool Contamination Caused by pg_dump

    Sometimes, interactions between components manifest in subtle ways. For example, using pg_dump to export data from a connection pool can cause connection pool contamination issues.

    Read more

    Sometimes, interactions between components manifest in subtle ways. For example, using pg_dump to export data from a connection pool can cause connection pool contamination issues.

    Read more

  • PostgreSQL Data Page Corruption Repair

    November 29, 2018 in PostgreSQL

    PostgreSQL Data Page Corruption Repair

    Using binary editing to repair PostgreSQL data pages, and how to make a primary key query return two records.

    Read more

    Using binary editing to repair PostgreSQL data pages, and how to make a primary key query return two records.

    Read more

  • Relation Bloat Monitoring and Management

    October 06, 2018 in PostgreSQL

    Relation Bloat Monitoring and Management

    PostgreSQL uses MVCC as its primary concurrency control technology. While it has many benefits, it also brings other effects, such as relation bloat.

    Read more

    PostgreSQL uses MVCC as its primary concurrency control technology. While it has many benefits, it also brings other effects, such as relation bloat.

    Read more

  • TimescaleDB Quick Start

    September 07, 2018 in PostgreSQL

    TimescaleDB Quick Start

    TimescaleDB is a PostgreSQL extension plugin that provides time-series database functionality.

    Read more

    TimescaleDB is a PostgreSQL extension plugin that provides time-series database functionality.

    Read more