XMLWordPrintable

    • S24-W18/19
    • 0.5

      Since PostegreSQL 10, it is possible to use more effective query to find active autovacuums. It is possible due to appearance of backend_type column in pg_stat_activity.

      SQL query should be changed

      from OLD one:

      SELECT count(*)
      FROM pg_catalog.pg_stat_activity
      WHERE query like '%%autovacuum%%'
      AND state <> 'idle'
      AND pid <> pg_catalog.pg_backend_pid()

      to NEW one:

      SELECT count(*)
      FROM pg_catalog.pg_stat_activity
      WHERE backend_type = 'autovacuum worker'
      AND state <> 'idle'
      AND pid <> pg_catalog.pg_backend_pid()

       

            abrosimovs Aleksejs Abrosimovs
            abrosimovs Aleksejs Abrosimovs
            Team INT
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: