All news

  • | MVCC in PostgreSQL — 6. Vacuum

    We started with problems related to isolation, made a digression about low-level data structure, then discussed row versions and observed how data snapshots are obtained from row versions.

    Last time we talked about HOT updates and in-page vacuuming, and today we'll proceed to a well-known vacuum vulgaris. Really, so much has already been written about it that I can hardly add anything new, but the beauty of a full picture requires sacrifice. So keep patience.

    Vacuum

    What does vacuum do?

    In-page vacuum works fast, but frees only part of the space. It works within one table page and does not touch indexes.

    The basic, "normal" vacuum is done using the VACUUM command, and we will call it just "vacuum" (leaving "autovacuum" for a separate discussion).

    So, vacuum processes the entire table. It vacuums away not only dead tuples, but also references to them from all indexes.

    Vacuuming is concurrent with other activities in the system. The table and indexes can be used in a regular way both for reads and updates (however, concurrent execution of commands such as CREATE INDEX, ALTER TABLE and some others is impossible).

    Only those table pages are looked through where some activities took place. To detect them, the visibility map is used (to remind you, the map tracks those pages that contain pretty old tuples, which are visible in all data snapshots for sure). Only those pages are processed that are not tracked by the visibility map, and the map itself gets updated.

    The free space map also gets updated in the process to reflect the extra free space in the pages.

    ...

  • | MVCC in PostgreSQL — 5. In-page vacuum and HOT updates

    Just to remind you, we already discussed issues related to isolation, made a digression regarding low-level data structure, and then explored row versions and observed how data snapshots are obtained from row versions.

    Now we will proceed to two closely connected problems: in-page vacuum и HOT updates. Both techniques can be referred to optimizations; they are important, but virtually not covered in the documentation.

    In-page vacuum during regular updates

    When accessing a page for either an update or read, if PostgreSQL understands that the page is running out of space, it can do a fast in-page vacuum. This happens in either of the cases:

    1. A previous update in this page did not find enough space to allocate a new row version in the same page. Such a situation is remembered in the page header, and next time the page is vacuumed.
    2. The page is more than fillfactor percent full. In this case, vacuum is performed right away without putting off till next time.

  • Hacking PostgreSQL 13 Webinar: Questions & Answers

    | Hacking PostgreSQL 13 Webinar: Questions & Answers

    To get things done before 2020 is over, I decided to publish my blog post with answers to your questions from our webinar on PostgreSQL 13 that we hosted in October. I’m still looking into release 13 and will soon give another talk on PG13 monitoring-related features that became available in this version of PostgreSQL. For now, let’s go through the webinar questions.

Blog

  • pg_probackup

    Pg_probackup is a utility to manage backup and recovery of PostgreSQL database clusters. It is designed to perform periodic backups of the PostgreSQL instance that enable you to restore the server in case of a failure.

  • JsQuery

    JsQuery – is a language to query jsonb data type, introduced in PostgreSQL release 9.4. It's primary goal is to provide an additional functionality to jsonb (currently missing in PostgreSQL), such as a simple and effective way to search in nested objects and arrays, more comparison operators with indexes support.

  • mamonsu

    An active monitoring agent for Postgres Pro. Based on zabbix, mamonsu provides an extensible cross-platform solution that can collect and visualize multiple Postgres Pro and system metrics.

  • pg_variables

    Functions for defining and using variables in client sessions.

Postgres Extensions

  • Connection pooling

    Working with large number of simultaneous connections almost inevitably leads to usage of connection pools. Unfortunately, present pooling solutions are very limited in access to all PostgreSQL features.

  • Effective table partitioning

    pg_pathman extension had been developed by Postgres Professional several years ago. It provides the most effective way to partition tables in a database, capable of having thousands of partitions per table. Later a similar partitioning functionality had appeared in community PostgreSQL, being easier in administration, but remarkably less effective. Now we are working on the unification of both partitioning engines.

  • Query plans management

    Business-critical applications require continuous monitoring and adjustment of query plans. The problem hardens due the fact that actual resources consumption by query execution could differ significantly with slight changes of the query plan cost. Thus, there is a permanent risk of bad plan selection and overall system performance degradation after collecting new statistics. DBAs want to protect themselves from this risk by freezing plans of particular most critical queries.

Roadmap

.


Tasks

Postgres Professional

Postgres Professional is the Russian PostgreSQL company founded by Russian PostgreSQL contributors. Company has 50+ employees, among them three Major PostgreSQL Contributors.

Postgres Professional is an active member of international PostgreSQL community, developers had committed 93 patches to the latest release of PostgreSQL 10.0.

Our company had successfully performed large PostgreSQL projects including database migration projects for well-known Russian and international companies. We provide industrial PostgreSQL services: vendor technical support, migration, custom extensions and core patches development, migration-related consulting, training and certification.