Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p79OC-0000cM-Bc for pgsql-general@arkaria.postgresql.org; Mon, 19 Dec 2022 06:12:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p79OA-0000YM-Ur for pgsql-general@arkaria.postgresql.org; Mon, 19 Dec 2022 06:12:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p79O9-0000X1-NG for pgsql-general@lists.postgresql.org; Mon, 19 Dec 2022 06:12:38 +0000 Received: from mail-ve1eur01olkn2026.outbound.protection.outlook.com ([40.92.66.26] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p79O5-0002vn-QA for pgsql-general@lists.postgresql.org; Mon, 19 Dec 2022 06:12:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ldJz6UiKIVb/chviKVqInLiU0N3fhdrhVsZdsjqzlqNEoqRvgwcmCO8Ez62eSJPyn062Fmp9PDwWX6TXFXmsq8jJm5CLrifOc9JSP7JUafG2jD4XxFeouORhIBpB1n4ZPMj4dbRKQls2QsmoPZfF1m/NhJo5D39jooGqaN4qwbl7lzPOdSYqHO/i/+jV2mYRsfMZUKXBnDePZWTp0ZpJwYv9ktg1SDks1dEvSJLdEH4JnReC/Sz06KjNxRvLYx1LaD5bRjI2yD5vytzVS+ML8DuWovqBxpft/XwRWmBl7YcpFyu/d3AGw35IqYpwX+r430KKGNmAPT1Xn/8iQSDl4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nWbDSxKXSxMc9L1clFkX6ApzAaWvneR60zI4TBQbnDE=; b=T91TRk5uJQIiuZ/sDp+JyLI0HDcdXYz/+/kjwGQA6kqboL7/sfMwWNiMXUlYO0nKPlGLJ9RwowCnRYynz3CsqK0LpxCaL3qcf8OFwnKv5uYDoDUbWn4mNCy5kb4umqHSsA6oCiCVicxR3LRPK4UTEwfiEIznHAyhHqjhU64Y1UE3yl5AiAl3my22dj2X8tftA5nISw9p2yOwJ9D3smvagBvuE7vDJkvX4ECTUnOD2tXbA9tWM7QxA7CB1BaekQc+i6rhGuunP417LJyqfnrcrCU9Flox3ot+Ijkafylc7usp4/7ZBEqcYZ/G8YGbVdW8+9rigCdcq9qtZGN4/pGKww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nWbDSxKXSxMc9L1clFkX6ApzAaWvneR60zI4TBQbnDE=; b=Rpb+mzdPmwZ8kPeoQBnSQ6FoCW/O35taTKEDbRpEGN9NyKNItH+57vfRh0DjVdbbqhEycpjs3yRI6Zz+Agje5phcnmJ1+FH78iKoLDVP1CrJYQHDFJyj0oZ2yg92qdSzEVIDz16/V9ZPmMA2qUJgKjL++odNeUFa/eZBgKzeGMMELAztxkYhXKutUHDeC6HymP4pLfqyZg3JJ+EkkDpLH32bUUcRVNQ1Lg2F0ispYh1U9ZeYhNFiXFgY0Pnjv5GDh4fyZeD2XsyarKgYc4fPFL6deijISZDqBuij5r3f54uk4df/U5gmVJ92MFSE3V5EsZeTLzrKV0Exo2ChccPzpA== Received: from AM9P251MB0330.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:41c::6) by AS4P251MB0414.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:4be::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 19 Dec 2022 06:12:29 +0000 Received: from AM9P251MB0330.EURP251.PROD.OUTLOOK.COM ([fe80::a60d:1561:b1ce:4b7a]) by AM9P251MB0330.EURP251.PROD.OUTLOOK.COM ([fe80::a60d:1561:b1ce:4b7a%8]) with mapi id 15.20.5924.016; Mon, 19 Dec 2022 06:12:29 +0000 From: Inzamam Shafiq To: Thomas Boussekey CC: "pgsql-general@lists.postgresql.org" Subject: Re: Autovacuum on sys tables Thread-Topic: Autovacuum on sys tables Thread-Index: AQHZEecb7ZSsozLaCk2Eav4k4i5CnK5zfHYAgAFBEyk= Date: Mon, 19 Dec 2022 06:12:29 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [4ScJYSefoJ2xvEjhZL05bA/mMPkEw2Qu] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM9P251MB0330:EE_|AS4P251MB0414:EE_ x-ms-office365-filtering-correlation-id: 0518bcb3-793d-4cab-670c-08dae188022a x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: x5vffcxw4795gb2LRZqWcY1SkBG9h0l4k4qBl/ciAVDISjisMvHw15JfpT4C/G+qpL3kEQfBXZlpUUNNp0IYlEKGpgBQT/xH2GaNPJ/cxYo9sr9Y6lWqIiOiGKxpxYruc8+My/DE6tWJgBBb63q/mJgPIj/GwSiGoxFTpZchGmArmMfGemuJT1/CoGxJhcrrMGTYhkeuD5bqmZ+ADw/EQYKIAG38TCpqnaKqVV4szEf6qHt0rn0LDc6DKarAI/sVQ0X8Mu64A7WUQRlpLmkd9Iv9lFoux1L+zhl5GLWzu2HmyjWK8bp4eaFfzHl9HDYM+XWJmrOs09ipDOgM+6ldIvR1jNtthaq/Q875ZVN3SEfKNKPODutK4jwdb+j2QZ+SC6TCKoQe281eu/UKpHe5QCwU+KLr7n1N3JWp2cY8hGQPF6+0p0ba7KMeHqFOpICungVg3mcROXR/gQaekMqGBfToUFDhhlWrCn3+QEYOfJW4/jCvpcc4GES3GYMMHS2VcXHLgZd6cjE+duMhjw6EjIjyqYN6O1CrNRUEATk+VrqmaTWN/wLmbw+6spdDICifnSu52GfJhT8r0eiKVUCZxLwqEvLuDOdMPi8os3K7ehi22+fZkar5r85UtQEuqos4ZefHlztCZhi+8t4VHFcjWF+BiJ9cR1O16nNUJvMuKco= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?3VixHn/2nplgTihf9F0i/LWnU9NrGehE6PuqbFoGoaFfZIiWvA6uPu8eMK?= =?iso-8859-1?Q?7YXfAo+LJ5dz8rYLU4n8IoTVeBzJmH27n3PrpCkzIp/AI9RVmB7v7D7R9L?= =?iso-8859-1?Q?/GYQ7pz2XpVnda6//LvwFqqwP9LzKnmdHGI+MYIPBd6wd0GZtDaI3SHMea?= =?iso-8859-1?Q?pxp5ac079diUOhO2mUL4EdKYyEN49UxCU0EEr0YjmhIZeeaDwpWwOp+MPG?= =?iso-8859-1?Q?q6Tu2WLLATPgIKfbyiGpFy8QTHrWWeu0Ddko9APrCXM8Ool63MGzArpYrG?= =?iso-8859-1?Q?ZqltNY4zyalh+KyuLK0HBQPGccyt3s2Sn3pcKDr+NqBqVpjUVsA3gSJ8Aa?= =?iso-8859-1?Q?iGUBtPNXsnT82TcVAkjwv4tJElJ7K0PzCwPx9/pQg+S3aXm6NPWzoHwZV4?= =?iso-8859-1?Q?AB9eh9uC8vnTay+jkrDo+rJOAVjbZj4RgjM4HpyGCwZZwJL+Fdh5H1Sg/3?= =?iso-8859-1?Q?WIB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3D=3D?= Content-Type: multipart/alternative; boundary="_000_AM9P251MB0330F9629060DF4A146F337498E59AM9P251MB0330EURP_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-00b75.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM9P251MB0330.EURP251.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 0518bcb3-793d-4cab-670c-08dae188022a X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2022 06:12:29.4169 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P251MB0414 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_AM9P251MB0330F9629060DF4A146F337498E59AM9P251MB0330EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks Thomas for the response, It means if I run VACUUM ANALYZE on pg_attribute or pg_class table, it is c= ompletely safe? Can you please also please confirm what is meant by "mid-le= vel" vacuum? Regards, Inzamam Shafiq Sr. DBA ________________________________ From: Thomas Boussekey Sent: Sunday, December 18, 2022 4:01 PM To: Inzamam Shafiq Cc: pgsql-general@lists.postgresql.org Subject: Re: Autovacuum on sys tables Hello Inzamam, Le sam. 17 d=E9c. 2022 =E0 08:16, Inzamam Shafiq > a =E9crit : Dear Experts, Hope you are doing well. I have a question that autovacuum is running on sys tables like pg_class, p= g_attribute, is it a normal thing? Further, what is dead tuples are not rem= oved from Autovacuum, can we remove the dead tuples using FULL VACUUMM or p= g_repack on sys tables? pg_repack cannot run on system tables, it will FAIL with an explicit error = message explaining the limitation. Each time you perform DDL operations (CREATE, DROP, ALTER), rows are insert= ed/updated or deleted into the system tables : pg_class, pg_attribute ... Autovacuum operations perform "low-level" operations, it can be interesting= to perform "middle-level" vacuum with VACUUM ANALYZE... that is not blocki= ng, but will be more a resource-consuming operation than autovacuum. Performing VACUUM FULL operation will block access to these pillar tables o= f your database. If your application/users can handle it, go ahead! At work on this kind of operation, I set a statement_timeout, in order to p= roperly stop the process if it is over a defined amount of time. Hope this helps, Thomas Thank you. Regards, Inzamam Shafiq Sr. DBA --_000_AM9P251MB0330F9629060DF4A146F337498E59AM9P251MB0330EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thanks Thomas for the response,

It means if I run VACUUM ANALYZE on pg_attribute or pg_class table, it is completely safe? Can you please also please confi= rm what is meant by "mid-level" vacuum?

Regards,

Inzamam Shafiq
Sr. DBA

From: Thomas Boussekey <= thomas.boussekey@gmail.com>
Sent: Sunday, December 18, 2022 4:01 PM
To: Inzamam Shafiq <inzamam.shafiq@hotmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postg= resql.org>
Subject: Re: Autovacuum on sys tables
 
Hello Inzamam,

Le sam. 17 d=E9c. 2022 =E0&nbs= p;08:16, Inzamam Shafiq <i= nzamam.shafiq@hotmail.com> a =E9crit :
Dear Experts,

Hope you are doing well.

I have a question that autovacuum is running = on sys tables like pg_class, pg_attribute, is it a normal thing? Further, what is dead tuples are not removed from Autovacuum, can w= e remove the dead tuples using FULL VACUUMM or pg_repack on sys tables?

pg_repack cannot run on system tables, it will FAIL with an explicit error = message explaining the limitation.

Each time you perform DDL operations (CREATE, DROP, ALTER), rows are insert= ed/updated or deleted into the system tables : pg_class, pg_attribute ...
Autovacuum operations perform "low-level" operations, it can be i= nteresting to perform "middle-level" vacuum with VACUUM ANALYZE..= . that is not blocking, but will be more a resource-consuming operation tha= n autovacuum.

Performing VACUUM FULL operation will block access to these pillar tables o= f your database. 
If your application/users can handle it, go ahead! 
At work on this kind of operation, I set a statement_timeout, in order= to properly stop the process if it is over a defined amount of time.

Hope this helps,
Thomas

Thank you.

Regards,

Inzamam Shafiq
Sr. DBA
--_000_AM9P251MB0330F9629060DF4A146F337498E59AM9P251MB0330EURP_--