{"id":496334,"date":"2026-09-28T08:52:08","date_gmt":"2026-09-28T08:52:08","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=496334"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=496334","title":{"rendered":"PostgreSQL 19 Beta 4: \u043f\u044f\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u043d\u0430 staging \u0434\u043e \u0440\u0435\u043b\u0438\u0437\u0430"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>24 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f \u0432\u044b\u0448\u043b\u0430 PostgreSQL 19 Beta 4. \u0414\u043e release candidate \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0430 \u043d\u0430 \u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 backend-\u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>\u0412 \u0440\u0435\u043b\u0438\u0437\u0435 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 \u0432\u0440\u043e\u0434\u0435 <code>REPACK<\/code>, \u043d\u043e\u0432\u043e\u0433\u043e <code>WAIT FOR LSN<\/code>, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e autovacuum, \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 sequence \u0438 <code>pg_plan_advice<\/code>. \u041d\u043e \u043f\u043e\u0447\u0442\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u00ab\u0434\u0430, \u043d\u043e\u00bb. <code>REPACK (CONCURRENTLY)<\/code> \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00abVACUUM FULL \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a\u00bb. <code>WAIT FOR LSN<\/code> \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 hint-\u044b \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0435\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u0437\u043e\u0440\u0430 \u00ab50 \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447 PostgreSQL 19\u00bb \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u044f\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c staging \u0434\u043e GA. \u041d\u0435 \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0432 production, \u0430 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u0442\u044c, \u0430 \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f.<\/p>\n<blockquote>\n<p>\u0412\u0430\u0436\u043d\u0430\u044f \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0430: PostgreSQL 19 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 beta. PostgreSQL Project \u043f\u0440\u044f\u043c\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c beta-\u0440\u0435\u043b\u0438\u0437\u044b \u0432 production. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 Beta 4 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u044b\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438\u0437 \u0440\u0435\u043b\u0438\u0437\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f SQL\/PGQ, online-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 checksums, <code>FOR PORTION OF<\/code> \u0434\u043b\u044f UPDATE\/DELETE \u0438 merge\/split partitions. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e Beta 4, \u0430 \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u044e\u043d\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0437\u043e\u0440\u044b Beta 1.<\/p>\n<\/blockquote>\n<h3>1. REPACK: \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0448\u0442\u0430\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043c\u0435\u0436\u0434\u0443 VACUUM \u0438 \u00ab\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043c\u0438\u0440\u00bb<\/h3>\n<p>\u0421\u0442\u0430\u0440\u044b\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u043b\u0433\u043e \u0436\u0438\u0432\u0451\u0442 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 PostgreSQL-\u0431\u0430\u0437\u043e\u0439. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0436\u0438\u043b\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0435 UPDATE\/DELETE, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u0434\u0443\u043b\u0441\u044f, \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <code>VACUUM<\/code> \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0433\u043e \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u043b.<\/p>\n<p><code>VACUUM FULL<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u043e, \u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 <code>ACCESS EXCLUSIVE<\/code>. \u041d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 maintenance window \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n<p>\u0412 PostgreSQL 19 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430:<\/p>\n<pre><code class=\"sql\">REPACK orders;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u043d\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u041e\u0421. \u0411\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0436\u0451\u0441\u0442\u043a\u043e\u0435: \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0435\u0440\u0451\u0442\u0441\u044f <code>ACCESS EXCLUSIVE<\/code>.<\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<pre><code class=\"sql\">REPACK (CONCURRENTLY) orders;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438 concurrent-\u0440\u0435\u0436\u0438\u043c\u0435 PostgreSQL \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 logical decoding. \u042d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u0430 \u2014 \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 swap \u0441\u0442\u0430\u0440\u044b\u0445 \u0438 \u043d\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>\u042d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 production-\u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>\u041d\u043e \u044f \u0431\u044b \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b \u044d\u0442\u043e \u0432 cron \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0423 <code>CONCURRENTLY<\/code> \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f: \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e replica identity, \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f partitioned \u0438 unlogged tables, \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 replication slot, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 <code>ACCESS EXCLUSIVE<\/code> \u2014 \u0432\u0441\u0451 \u0435\u0449\u0451 <code>ACCESS EXCLUSIVE<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, PostgreSQL \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u043f\u0435\u0440\u0435\u0434 swap. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u00abconcurrent\u00bb \u0437\u0434\u0435\u0441\u044c \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00ab\u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c DML\u00bb, \u0430 \u043d\u0435 \u00ab\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u00bb.<\/p>\n<p>\u0414\u043b\u044f backend-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u044f \u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u044f REPACK, \u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0435\u0449\u0438:<\/p>\n<pre><code>peak temporary disk usage        +WAL \/ replication lag        +\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e ACCESS EXCLUSIVE        +\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c DDL<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 20 \u0413\u0411 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u0430 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0442\u0435\u043d \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c.<\/p>\n<p>\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c: \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>pg_stat_progress_repack<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0430\u044f, \u0430 \u043d\u0435 \u043a\u0430\u043a \u00ab\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0438 \u0436\u0434\u0451\u043c\u00bb.<\/p>\n<h3>2. WAIT FOR LSN \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0440\u0443\u044e \u0434\u044b\u0440\u0443 primary \u2192 replica<\/h3>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code>WRITE -&gt; primaryREAD  -&gt; replica<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u043c\u044f, \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u0432\u0438\u0434\u0438\u0442 \u0441\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u0431\u0430\u0433 \u0440\u0435\u043f\u043b\u0438\u043a\u0438. \u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u0430\u044f eventual consistency: HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u0441 UPDATE \u0443\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f \u043d\u0430 primary, \u0430 WAL \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u043f\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430 standby.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432: \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0438\u0442\u0430\u0435\u0442 \u0441 primary, \u0442\u0430\u0449\u0438\u0442 sticky-\u0444\u043b\u0430\u0433 \u0432 \u0441\u0435\u0441\u0441\u0438\u0438 \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u043e\u0438\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f replication lag.<\/p>\n<p>\u0412 PostgreSQL 19 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>WAIT FOR LSN<\/code>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 primary \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e WAL:<\/p>\n<pre><code class=\"sql\">UPDATE usersSET display_name = 'Alice'WHERE id = 42;SELECT pg_current_wal_insert_lsn();-- \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 0\/0306EE20<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043d\u0430 replica \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<pre><code class=\"sql\">WAIT FOR LSN '0\/0306EE20'WITH (    MODE 'standby_replay',    TIMEOUT '200ms',    NO_THROW);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 <code>success<\/code>, <code>timeout<\/code> \u0438\u043b\u0438 <code>not in recovery<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 <code>success<\/code>, standby \u0443\u0436\u0435 replay-\u043d\u0443\u043b\u0430 WAL \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0434\u0442\u0438 \u0442\u0443\u0434\u0430. \u0415\u0441\u043b\u0438 <code>timeout<\/code>, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u0439\u0442\u0438 \u043d\u0430 primary.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 routing:<\/p>\n<pre><code class=\"python\">async def consistent_read(lsn, replica, primary):    status = await replica.wait_for_lsn(        lsn,        timeout_ms=200,    )    if status == \"success\":        return await replica.fetch_user()    return await primary.fetch_user()<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u043c\u044b\u0441\u043b \u043d\u0435 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c Python API \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c SQL-\u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u0412\u0430\u0436\u0435\u043d \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442: \u0432\u043c\u0435\u0441\u0442\u043e \u00ab\u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e replica \u0434\u043e\u0433\u043d\u0430\u043b\u0430\u00bb \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f WAL.<\/p>\n<p>\u041d\u043e \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u0432\u0443\u0448\u043a\u0430. LSN \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c <strong>\u043f\u043e\u0441\u043b\u0435 commit<\/strong>, \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 pooler-\u0430, \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c\u0438. PostgreSQL \u0441\u0430\u043c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, <code>WAIT<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e snapshot \u0438 locks, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e standby replay \u0441\u0430\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0436\u0434\u0451\u0442 replay. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0446\u0438\u043a\u043b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439:<\/p>\n<pre><code>primary:    transaction -&gt; COMMIT -&gt; capture LSNreplica:    WAIT FOR LSN    -&gt; success -&gt; SELECT    -&gt; timeout -&gt; fallback to primary<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u043b\u044f API \u0441 read replicas \u044d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 PostgreSQL 19.<\/p>\n<h3>3. Autovacuum \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u00ab\u0447\u0442\u043e \u0432\u0430\u043a\u0443\u0443\u043c\u0438\u0442\u044c\u00bb, \u043d\u043e \u0438 \u00ab\u0447\u0442\u043e \u0432\u0430\u0436\u043d\u0435\u0435\u00bb<\/h3>\n<p>\u041d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0430\u0437\u0430\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 autovacuum \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u043b\u0438 \u0441\u0432\u043e\u0438 thresholds. Worker-\u044b \u0437\u0430\u043d\u044f\u0442\u044b, \u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0436\u0434\u0451\u0442. \u0414\u043e PostgreSQL 19 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u044b \u0431\u044b\u043b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u0435\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0438\u0441\u043a\u0430.<\/p>\n<p>\u0412 19 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f scoring system. PostgreSQL \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c: \u0432\u043e\u0437\u0440\u0430\u0441\u0442 XID, multixact, \u043e\u0431\u044a\u0451\u043c UPDATE\/DELETE, INSERT \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c ANALYZE. \u0412\u0435\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f view:<\/p>\n<pre><code class=\"sql\">SELECT *FROM pg_stat_autovacuum_scoresORDER BY score DESC;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c: \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u043f\u043e\u0447\u0435\u043c\u0443 autovacuum \u043f\u043e\u0448\u0451\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443?\u00bb \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e autovacuum \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c parallel workers \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432. \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0435\u043b \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437:<\/p>\n<pre><code>autovacuum_max_parallel_workers<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c storage parameter <code>autovacuum_parallel_workers<\/code>.<\/p>\n<p>\u0412\u0430\u0436\u043d\u043e \u043d\u0435 \u0441\u043f\u0443\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u00abVACUUM \u0441\u0442\u0430\u043b N \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435\u00bb. Parallel Vacuum \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e index vacuuming \u0438 cleanup, \u043f\u0440\u0438\u0447\u0451\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0430 \u0447\u0438\u0441\u043b\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 workers \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043e\u0434\u043d\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u044d\u0444\u0444\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u043c\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438 \u2014 \u0443\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c.<\/p>\n<p>\u042f \u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 19 \u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0440\u044b\u0439 autovacuum config \u0432\u0441\u043b\u0435\u043f\u0443\u044e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u043b \u0431\u044b baseline \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c vacuum, lag \u043f\u043e dead tuples, I\/O, \u0441\u043b\u0443\u0447\u0430\u0438 wraparound pressure. \u041f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u0430\u043b \u0431\u044b \u0442\u043e\u0442 \u0436\u0435 workload \u043d\u0430 19 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u0437\u0430 I\/O.<\/p>\n<p>\u041d\u043e\u0432\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442.<\/p>\n<h3>4. Logical replication \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e sequence \u2014 \u043d\u043e \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f<\/h3>\n<p>\u041f\u0440\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0435\u043b\u043a\u0430\u044f \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0435\u0445\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u043e. \u0410 \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e sequence \u043d\u0430 subscriber \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0437\u0430\u0434\u0438.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 cutover \u043d\u043e\u0432\u044b\u0439 <code>nextval()<\/code> \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u043c primary.<\/p>\n<p>\u0412 PostgreSQL 19 sequence \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"sql\">CREATE PUBLICATION app_pubFOR ALL TABLES, ALL SEQUENCES;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 subscription \u0441 <code>copy_data = true<\/code> \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f sequence \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u0415\u0441\u0442\u044c \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"sql\">ALTER SUBSCRIPTION app_subREFRESH SEQUENCES;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0417\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u00absequence \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u00bb, \u043d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0434\u043e\u0431\u043d\u043e.<\/p>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 publisher \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0443\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043f\u0435\u0440\u0451\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 subscriber \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u0442\u0430\u0442\u044c. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e sequence, \u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 <code>nextval()<\/code> \u0432 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0435 logical-replication event.<\/p>\n<p>\u0414\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 runbook. \u0412\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0445\u043e\u0434\u0438\u0442 <code>pg_sequences<\/code>, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u044b \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 <code>setval()<\/code>, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0442\u0430\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.<\/p>\n<p>\u041d\u043e \u043f\u0435\u0440\u0435\u0434 cutover \u044f \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0431\u044b \u044f\u0432\u043d\u044b\u0439 \u0448\u0430\u0433:<\/p>\n<pre><code>stop writes-&gt; wait for table replication-&gt; REFRESH SEQUENCES-&gt; validate sequence state-&gt; switch traffic<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u043e\u0432\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041e\u043d\u0430 \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h3>5. pg_plan_advice: \u043a\u043e\u0433\u0434\u0430 \u00ab\u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u043b\u0430\u043d\u00bb \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0442\u044c<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0430\u043c\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u043e.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0447\u0435\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f 20 \u043c\u0441, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441\u0442\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f 4 \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0412\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 <code>EXPLAIN ANALYZE<\/code> \u0438 \u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e planner \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 join order \u0438\u043b\u0438 scan.<\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u0442\u0430\u043a\u0438\u043c\u0438: \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441, \u043c\u0435\u043d\u044f\u0442\u044c planner settings \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 session \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f hints.<\/p>\n<p>PostgreSQL 19 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 <code>pg_plan_advice<\/code>.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c advice \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440 planner-\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"sql\">SET pg_plan_advice.advice = 'JOIN_ORDER(f d)';EXPLAINSELECT *FROM join_fact fJOIN join_dim d ON f.dim_id = d.id;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e: \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u0442 planner \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u043b\u0430\u043d\u043e\u043c. \u041e\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 core planner \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442.<\/p>\n<p>\u0420\u044f\u0434\u043e\u043c \u0435\u0441\u0442\u044c <code>pg_stash_advice<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c advice \u043a query identifier \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u044d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u00abplan pinning\u00bb, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e PostgreSQL \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u0431\u0435\u0433\u0430\u043b.<\/p>\n<p>\u042f \u0431\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u043b\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u043a\u0430\u043a \u043a \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443, \u0430 \u043d\u0435 \u043a\u0430\u043a \u043a \u043d\u043e\u0432\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>\u0415\u0441\u043b\u0438 planner \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u043b\u0430\u043d \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0439 cardinality estimate, advice \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c latency \u0432 \u043d\u043e\u0440\u043c\u0443. \u041d\u043e \u043f\u0435\u0440\u0432\u043e\u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043d\u0438\u043a\u0443\u0434\u0430 \u043d\u0435 \u0438\u0441\u0447\u0435\u0437\u0430\u0435\u0442. \u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0432\u0442\u0440\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0441\u0442\u0430\u0440\u044b\u0439 \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439\u00bb \u043f\u043b\u0430\u043d \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043b\u043e\u0445\u0438\u043c, \u0430 \u043c\u044b \u0441\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u043b\u0438 planner-\u0443 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0421\u0430\u043c\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442: planner \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0438 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0445\u0443\u0434\u0448\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e. \u0414\u043b\u044f <code>pg_stash_advice<\/code> \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u0430 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f advice.<\/p>\n<p>\u042f \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u043e\u0439 workflow:<\/p>\n<pre><code>\u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u043f\u043b\u0430\u043d\u0430      |      v\u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 advice      |      v\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c production      |      v\u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443:statistics \/ index \/ query \/ data skew      |      v\u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443      |      v\u0443\u0434\u0430\u043b\u0438\u0442\u044c advice<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0435\u0434\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c, \u0435\u0441\u043b\u0438 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0441\u0440\u043e\u043a \u0436\u0438\u0437\u043d\u0438.<\/p>\n<h3>\u0427\u0442\u043e \u044f \u0431\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0434\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0423 PostgreSQL major release \u0440\u0435\u0434\u043a\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0434\u043d\u0430 \u00abkiller feature\u00bb, \u0440\u0430\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c production. \u0426\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0412 19 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432\u043e\u043a\u0440\u0443\u0433 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438: vacuum, I\/O, observability, replication, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u043d\u0430\u043c\u0438.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434 \u044f \u0431\u044b \u0441\u0442\u0440\u043e\u0438\u043b \u043d\u0435 \u043a\u0430\u043a \u00ab\u043f\u043e\u0434\u043d\u044f\u0442\u044c PostgreSQL 19 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c unit-\u0442\u0435\u0441\u0442\u044b\u00bb, \u0430 \u043a\u0430\u043a \u043a\u043e\u043f\u0438\u044e \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0445 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f bloat-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <code>REPACK (CONCURRENTLY)<\/code>, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, WAL \u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443.<\/p>\n<p>Primary + async replica \u2014 \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c <code>WAIT FOR LSN<\/code> \u043d\u0430 p50\/p95\/p99 replication lag \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0439 timeout \u0434\u043b\u044f fallback.<\/p>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438 \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c autovacuum \u0441 parallel workers \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <code>pg_stat_autovacuum_scores<\/code>.<\/p>\n<p>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c sequence sync \u0438 \u0441\u0432\u043e\u0439 cutover runbook.<\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 plan regressions \u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <code>pg_plan_advice<\/code> \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u0430\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u0445\u043e\u0432\u043a\u0443.<\/p>\n<p>\u0418 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043d\u043e\u0432\u044b\u0445 SQL-\u043a\u043e\u043c\u0430\u043d\u0434. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 PostgreSQL 19 JIT \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 PostgreSQL \u0441\u043e\u0447\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e cost-\u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0439. \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e OLTP \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0439\u0442\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u043b\u0438 \u043e\u0442 JIT, \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 Beta 4 \u0432\u0430\u0436\u043d\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u043e\u0431\u0437\u043e\u0440\u043e\u0432 PostgreSQL 19<\/h3>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u043b\u0438\u0437 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 Beta 1 \u0438 Beta 4 PostgreSQL Project \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u043b \u0431\u0430\u0433\u0438. \u0418\u0437 \u0440\u0435\u043b\u0438\u0437\u0430 \u0443\u0434\u0430\u043b\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0436\u0435 \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c announcement \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u044f\u043c\u043e: \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u0435\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0443\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0444\u0438\u0447\u0443 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c major release.<\/p>\n<p>\u0414\u043b\u044f production-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 reminder: \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u043e beta feature list \u0440\u0430\u043d\u043e.<\/p>\n<p>\u041d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c beta \u2014 \u043a\u0430\u043a \u0440\u0430\u0437 \u0432\u043e\u0432\u0440\u0435\u043c\u044f. \u041d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0434\u0435\u043b\u044e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 GA \u0441\u0430\u043c\u043e\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u2014 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0430\u043a\u0435\u0442\u0430. \u0421\u0430\u043c\u043e\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0435 \u2014 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043d\u043e\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u0432\u0430\u0448\u0435\u043c workload.<\/p>\n<p>PostgreSQL 19 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u043d\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043e\u0434\u043d\u0430 \u0440\u0435\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0421\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442: \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0440\u044b\u0445 operational pain points \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u043e\u043a\u0440\u0443\u0433 \u0431\u0430\u0437\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0415\u0441\u043b\u0438 <code>REPACK<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e tooling, <code>WAIT FOR LSN<\/code> \u2014 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c read-after-write \u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445, \u0430 autovacuum scoring \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0435\u0435, \u044d\u0442\u043e\u0433\u043e \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043b\u0438\u044f\u043b\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 DBA, \u043d\u043e \u0438 \u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 backend.<\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0441 \u0438\u0441\u0447\u0435\u0437\u043d\u043e\u0432\u0435\u043d\u0438\u0435\u043c \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0440\u0438\u0441\u043a\u0430.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1087440\/\">https:\/\/habr.com\/ru\/articles\/1087440\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>24 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f \u0432\u044b\u0448\u043b\u0430 PostgreSQL 19 Beta 4. \u0414\u043e release candidate \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u043d\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0430 \u043d\u0430 \u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 backend-\u043a\u043e\u043c\u0430\u043d\u0434\u044b.\u0412 \u0440\u0435\u043b\u0438\u0437\u0435 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 \u0432\u0440\u043e\u0434\u0435 REPACK, \u043d\u043e\u0432\u043e\u0433\u043e WAIT FOR LSN, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e autovacuum, \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 sequence \u0438 pg_plan_advice. \u041d\u043e \u043f\u043e\u0447\u0442\u0438 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u00ab\u0434\u0430, \u043d\u043e\u00bb. REPACK (CONCURRENTLY) \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00abVACUUM FULL \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a\u00bb. WAIT FOR LSN \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 hint-\u044b \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0438\u0434\u0435\u0435\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0431\u0437\u043e\u0440\u0430 \u00ab50 \u043d\u043e\u0432\u044b\u0445 \u0444\u0438\u0447 PostgreSQL 19\u00bb \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u044f\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043d\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c staging \u0434\u043e GA. \u041d\u0435 \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0438\u0445 \u0432 production, \u0430 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0441\u0442\u0430\u0440\u044b\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u0442\u044c, \u0430 \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f.\u0412\u0430\u0436\u043d\u0430\u044f \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0430: PostgreSQL 19 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 beta. PostgreSQL Project \u043f\u0440\u044f\u043c\u043e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c beta-\u0440\u0435\u043b\u0438\u0437\u044b \u0432 production. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 Beta 4 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u044b\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0438\u0437 \u0440\u0435\u043b\u0438\u0437\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f SQL\/PGQ, online-\u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 checksums, FOR PORTION OF \u0434\u043b\u044f UPDATE\/DELETE \u0438 merge\/split partitions. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e Beta 4, \u0430 \u043d\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u044e\u043d\u044c\u0441\u043a\u0438\u0435 \u043e\u0431\u0437\u043e\u0440\u044b Beta 1.1. REPACK: \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0448\u0442\u0430\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043c\u0435\u0436\u0434\u0443 VACUUM \u0438 \u00ab\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043c\u0438\u0440\u00bb\u0421\u0442\u0430\u0440\u044b\u0439 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u043b\u0433\u043e \u0436\u0438\u0432\u0451\u0442 \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 PostgreSQL-\u0431\u0430\u0437\u043e\u0439. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u0435\u0440\u0435\u0436\u0438\u043b\u0430 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0435 UPDATE\/DELETE, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u0434\u0443\u043b\u0441\u044f, \u043e\u0431\u044b\u0447\u043d\u044b\u0439 VACUUM \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u043c \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0433\u043e \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u043b.VACUUM FULL \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u043e, \u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 ACCESS EXCLUSIVE. \u041d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 maintenance window \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438.\u0412 PostgreSQL 19 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430:REPACK orders;\u041e\u043d\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u041e\u0421. \u0411\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0436\u0451\u0441\u0442\u043a\u043e\u0435: \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0435\u0440\u0451\u0442\u0441\u044f ACCESS EXCLUSIVE.\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:REPACK (CONCURRENTLY) orders;\u041f\u0440\u0438 concurrent-\u0440\u0435\u0436\u0438\u043c\u0435 PostgreSQL \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 logical decoding. \u042d\u043a\u0441\u043a\u043b\u044e\u0437\u0438\u0432\u043d\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u0430 \u2014 \u043d\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 swap \u0441\u0442\u0430\u0440\u044b\u0445 \u0438 \u043d\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.\u042d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 production-\u0442\u0430\u0431\u043b\u0438\u0446\u044b.\u041d\u043e \u044f \u0431\u044b \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b \u044d\u0442\u043e \u0432 cron \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.\u0423 CONCURRENTLY \u0435\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f: \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e replica identity, \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0434\u043b\u044f partitioned \u0438 unlogged tables, \u043d\u0443\u0436\u0435\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 replication slot, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 ACCESS EXCLUSIVE \u2014 \u0432\u0441\u0451 \u0435\u0449\u0451 ACCESS EXCLUSIVE.\u0415\u0441\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, PostgreSQL \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u043f\u0435\u0440\u0435\u0434 swap. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u00abconcurrent\u00bb \u0437\u0434\u0435\u0441\u044c \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u00ab\u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c DML\u00bb, \u0430 \u043d\u0435 \u00ab\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u00bb.\u0414\u043b\u044f backend-\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u044f \u0431\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u044f REPACK, \u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0435\u0449\u0438:peak temporary disk usage        +WAL \/ replication lag        +\u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e ACCESS EXCLUSIVE        +\u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c DDL\u041d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 20 \u0413\u0411 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u0430 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0442\u0435\u043d \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u043c.\u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u044c: \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0435\u0440\u0435\u0437 pg_stat_progress_repack. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u0430\u044f, \u0430 \u043d\u0435 \u043a\u0430\u043a \u00ab\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0438 \u0436\u0434\u0451\u043c\u00bb.2. WAIT FOR LSN \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0440\u0443\u044e \u0434\u044b\u0440\u0443 primary \u2192 replica\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0445 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e:WRITE -&gt; primaryREAD  -&gt; replica\u0410 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u043c\u044f, \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u0432\u0438\u0434\u0438\u0442 \u0441\u0442\u0430\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.\u042d\u0442\u043e \u043d\u0435 \u0431\u0430\u0433 \u0440\u0435\u043f\u043b\u0438\u043a\u0438. \u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u0430\u044f eventual consistency: HTTP-\u0437\u0430\u043f\u0440\u043e\u0441 \u0441 UPDATE \u0443\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f \u043d\u0430 primary, \u0430 WAL \u0435\u0449\u0451 \u043d\u0435 \u0443\u0441\u043f\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430 standby.\u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0440\u0451\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432: \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0438\u0442\u0430\u0435\u0442 \u0441 primary, \u0442\u0430\u0449\u0438\u0442 sticky-\u0444\u043b\u0430\u0433 \u0432 \u0441\u0435\u0441\u0441\u0438\u0438 \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u043e\u0438\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f replication lag.\u0412 PostgreSQL 19 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f WAIT FOR LSN.\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 primary \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e WAL:UPDATE usersSET display_name = &#8216;Alice&#8217;WHERE id = 42;SELECT pg_current_wal_insert_lsn();&#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 0\/0306EE20\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043d\u0430 replica \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:WAIT FOR LSN &#8216;0\/0306EE20&#8217;WITH (    MODE &#8216;standby_replay&#8217;,    TIMEOUT &#8216;200ms&#8217;,    NO_THROW);\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 success, timeout \u0438\u043b\u0438 not in recovery.\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 success, standby \u0443\u0436\u0435 replay-\u043d\u0443\u043b\u0430 WAL \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0434\u0442\u0438 \u0442\u0443\u0434\u0430. \u0415\u0441\u043b\u0438 timeout, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u0439\u0442\u0438 \u043d\u0430 primary.\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 routing:async def consistent_read(lsn, replica, primary):    status = await replica.wait_for_lsn(        lsn,        timeout_ms=200,    )    if status == &#171;success&#187;:        return await replica.fetch_user()    return await primary.fetch_user()\u0421\u043c\u044b\u0441\u043b \u043d\u0435 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c Python API \u2014 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0443 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c SQL-\u043a\u043e\u043c\u0430\u043d\u0434\u0443. \u0412\u0430\u0436\u0435\u043d \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442: \u0432\u043c\u0435\u0441\u0442\u043e \u00ab\u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e replica \u0434\u043e\u0433\u043d\u0430\u043b\u0430\u00bb \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044f WAL.\u041d\u043e \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u0432\u0443\u0448\u043a\u0430. LSN \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435 commit, \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u043b\u0438 pooler-\u0430, \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c\u0438. PostgreSQL \u0441\u0430\u043c \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c.\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, WAIT \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u0434\u043b\u0438\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e snapshot \u0438 locks, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e standby replay \u0441\u0430\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0436\u0434\u0451\u0442 replay. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0446\u0438\u043a\u043b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f.\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439:primary:    transaction -&gt; COMMIT -&gt; capture LSNreplica:    WAIT FOR LSN    -&gt; success -&gt; SELECT    -&gt; timeout -&gt; fallback to primary\u0414\u043b\u044f API \u0441 read replicas \u044d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 PostgreSQL 19.3. Autovacuum \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u00ab\u0447\u0442\u043e \u0432\u0430\u043a\u0443\u0443\u043c\u0438\u0442\u044c\u00bb, \u043d\u043e \u0438 \u00ab\u0447\u0442\u043e \u0432\u0430\u0436\u043d\u0435\u0435\u00bb\u041d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0430\u0437\u0430\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 autovacuum \u0447\u0430\u0441\u0442\u043e \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d \u0438\u043b\u0438 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u0438.\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u043b\u0438 \u0441\u0432\u043e\u0438 thresholds. Worker-\u044b \u0437\u0430\u043d\u044f\u0442\u044b, \u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0436\u0434\u0451\u0442. \u0414\u043e PostgreSQL 19 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u044b \u0431\u044b\u043b \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u0435\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0438\u0441\u043a\u0430.\u0412 19 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f scoring system. PostgreSQL \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u043e\u0432 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c: \u0432\u043e\u0437\u0440\u0430\u0441\u0442 XID, multixact, \u043e\u0431\u044a\u0451\u043c UPDATE\/DELETE, INSERT \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c ANALYZE. \u0412\u0435\u0441\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432.\u041f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f view:SELECT *FROM pg_stat_autovacuum_scoresORDER BY score DESC;\u042d\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c: \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u043f\u043e\u0447\u0435\u043c\u0443 autovacuum \u043f\u043e\u0448\u0451\u043b \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443?\u00bb \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c\u044b\u043c.\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e autovacuum \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c parallel workers \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432. \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0435\u043b \u0437\u0430\u0434\u0430\u0451\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437:autovacuum_max_parallel_workers\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c storage parameter autovacuum_parallel_workers.\u0412\u0430\u0436\u043d\u043e \u043d\u0435 \u0441\u043f\u0443\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u00abVACUUM \u0441\u0442\u0430\u043b N \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435\u00bb. Parallel Vacuum \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e index vacuuming \u0438 cleanup, \u043f\u0440\u0438\u0447\u0451\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0430 \u0447\u0438\u0441\u043b\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 workers \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e.\u0422\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043e\u0434\u043d\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u044d\u0444\u0444\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u044b\u043c. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u043c\u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c\u0438 \u2014 \u0443\u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c.\u042f \u0431\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 19 \u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u0441\u0442\u0430\u0440\u044b\u0439 autovacuum config \u0432\u0441\u043b\u0435\u043f\u0443\u044e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u043b \u0431\u044b baseline \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438: \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c vacuum, lag \u043f\u043e dead tuples, I\/O, \u0441\u043b\u0443\u0447\u0430\u0438 wraparound pressure. \u041f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u043d\u0430\u043b \u0431\u044b \u0442\u043e\u0442 \u0436\u0435 workload \u043d\u0430 19 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0446\u0438\u044f \u0437\u0430 I\/O.\u041d\u043e\u0432\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442.4. Logical replication \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0437\u043d\u0430\u0435\u0442 \u043f\u0440\u043e sequence \u2014 \u043d\u043e \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f\u041f\u0440\u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u0435\u043b\u043a\u0430\u044f \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u044c.\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0435\u0445\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u043e. \u0410 \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e sequence \u043d\u0430 subscriber \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u0437\u0430\u0434\u0438.\u041f\u043e\u0441\u043b\u0435 cutover \u043d\u043e\u0432\u044b\u0439 nextval() \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0441\u0442\u0430\u0440\u043e\u043c primary.\u0412 PostgreSQL 19 sequence \u043c\u043e\u0436\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c:CREATE PUBLICATION app_pubFOR ALL TABLES, ALL SEQUENCES;\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 subscription \u0441 copy_data = true \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f sequence \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u0415\u0441\u0442\u044c \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435:ALTER SUBSCRIPTION app_subREFRESH SEQUENCES;\u0417\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u00absequence \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u00bb, \u043d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0443\u0434\u043e\u0431\u043d\u043e.\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 publisher \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0443\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043f\u0435\u0440\u0451\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 subscriber \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0441\u043d\u043e\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u0441\u0442\u0430\u0442\u044c. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e sequence, \u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 nextval() \u0432 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0435 logical-replication event.\u0414\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 runbook. \u0412\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0445\u043e\u0434\u0438\u0442 pg_sequences, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u044b \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 setval(), \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0442\u0430\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f.\u041d\u043e \u043f\u0435\u0440\u0435\u0434 cutover \u044f \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0431\u044b \u044f\u0432\u043d\u044b\u0439 \u0448\u0430\u0433:stop writes-&gt; wait for table replication-&gt; REFRESH SEQUENCES-&gt; validate sequence state-&gt; switch traffic\u041d\u043e\u0432\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u041e\u043d\u0430 \u043d\u0435 \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c.5. pg_plan_advice: \u043a\u043e\u0433\u0434\u0430 \u00ab\u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u043b\u0430\u043d\u00bb \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0442\u044c\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0430\u043c\u0430\u044f \u043e\u043f\u0430\u0441\u043d\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u043e.\u0415\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0447\u0435\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f 20 \u043c\u0441, \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0441\u0442\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f 4 \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0412\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 EXPLAIN ANALYZE \u0438 \u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e planner \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 join order \u0438\u043b\u0438 scan.\u0420\u0430\u043d\u044c\u0448\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u0442\u0430\u043a\u0438\u043c\u0438: \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441, \u043c\u0435\u043d\u044f\u0442\u044c planner settings \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 session \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0434\u043b\u044f hints.PostgreSQL 19 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 pg_plan_advice.\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0442\u044c advice \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440 planner-\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:SET&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-496334","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/496334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=496334"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/496334\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=496334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=496334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=496334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}