Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhAkE-0007P1-SF for pgsql-docs@arkaria.postgresql.org; Tue, 06 Sep 2016 07:24:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bhAkE-00069w-AN for pgsql-docs@arkaria.postgresql.org; Tue, 06 Sep 2016 07:24:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bhAjs-0005ln-Az for pgsql-docs@postgresql.org; Tue, 06 Sep 2016 07:24:12 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhAjo-0003P5-VU for pgsql-docs@postgresql.org; Tue, 06 Sep 2016 07:24:11 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 31C3821C2802 for ; Tue, 6 Sep 2016 10:24:07 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru Received: from mail.postgrespro.ru ([127.0.0.1]) by localhost (mail.postgrespro.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uc_USqNBqHgy for ; Tue, 6 Sep 2016 10:24:07 +0300 (MSK) Received: from [192.168.43.221] (unknown [31.173.80.144]) by mail.postgrespro.ru (Postfix) with ESMTPSA id CEC7621C2801 for ; Tue, 6 Sep 2016 10:24:06 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1473146647; bh=s4Zon4LP9khW2y5yfoE6Tl4urMqYsvcMumcWhE4k6/k=; h=Subject:To:References:From:Date:In-Reply-To; b=kccaFCSJy6y3e3mxN2MnmuUX+R7fZLc6f6ak3Gtb6Z2IZDbr/BeemT51L9zcu9QKD st2/3GoimgBdPPX9Qvx+d4bnzXUD3lMl/a8QQ1GauXzhwPBMXSY7j7gewxAA1czfjv EtUP6ZThXtVG8fX+D3ccaj19qVXDj8tZz8aM+Opw= Subject: Re: FrozenTransactionId To: pgsql-docs@postgresql.org References: <575D7955.6060209@postgrespro.ru> <1473096445753-5919545.post@n3.nabble.com> <31833.1473097584@sss.pgh.pa.us> <57CDED18.8060005@postgrespro.ru> From: Egor Rogov Message-ID: <57CE6F15.4060101@postgrespro.ru> Date: Tue, 6 Sep 2016 10:24:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <57CDED18.8060005@postgrespro.ru> Content-Type: multipart/mixed; boundary="------------040001070200050902010508" X-Pg-Spam-Score: -1.5 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org This is a multi-part message in MIME format. --------------040001070200050902010508 Content-Type: multipart/alternative; boundary="------------050300020600070003030403" --------------050300020600070003030403 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sorry, my last email went without the attachment. On 06.09.2016 01:09, Egor Rogov wrote: > Tom Lane <[hidden email] > > writes: > > It'd be more likely to get pushed if you'd submitted it in an easily > > reviewable form, ie without reflowing the entire (rather long) > paragraph. > > As-is, it's much too hard to see what you changed or didn't change. > Please find another patch attached. I hope it is a bit easier to > review now. > > *maintenance-2.patch* (2K) Download Attachment > > Regards, Egor Rogov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --------------050300020600070003030403 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit Sorry, my last email went without the attachment.

On 06.09.2016 01:09, Egor Rogov wrote:
Tom Lane <[hidden email]> writes:
> It'd be more likely to get pushed if you'd submitted it in an easily
> reviewable form, ie without reflowing the entire (rather long) paragraph.
> As-is, it's much too hard to see what you changed or didn't change.
Please find another patch attached. I hope it is a bit easier to review now.

maintenance-2.patch (2K) Download Attachment

Regards,
Egor Rogov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

--------------050300020600070003030403-- --------------040001070200050902010508 Content-Type: text/x-patch; name="maintenance-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="maintenance-2.patch" diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 2713883..7d1ee4e 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -406,26 +406,23 @@ The reason that periodic vacuuming solves the problem is that - VACUUM will mark rows as frozen, indicating that + VACUUM will mark rows as frozen (by setting appropriate hint bits), indicating that they were inserted by a transaction which committed sufficiently far in the past that the effects of the inserting transaction is certain to be visible, from an MVCC perspective, to all current and future transactions. - PostgreSQL reserves a special XID, - FrozenTransactionId, which does not follow the normal XID - comparison rules and is always considered older - than every normal XID. Normal XIDs are + Usually XIDs are compared using modulo-232 arithmetic. This means - that for every normal XID, there are two billion XIDs that are + that for every XID, there are two billion XIDs that are older and two billion that are newer; another - way to say it is that the normal XID space is circular with no + way to say it is that the XID space is circular with no endpoint. Therefore, once a row version has been created with a particular - normal XID, the row version will appear to be in the past for - the next two billion transactions, no matter which normal XID we are - talking about. If the row version still exists after more than two billion + XID, the row version will appear to be in the past for + the next two billion transactions. + If the row version still exists after more than two billion transactions, it will suddenly appear to be in the future. To - prevent this, frozen row versions are treated as if the inserting XID were - FrozenTransactionId, so that they will appear to be - in the past to all normal transactions regardless of wraparound + prevent this, usual visibility rules are not applied to frozen row versions. + Instead they are considered to be + in the past to all transactions regardless of wraparound issues, and so such row versions will be valid until deleted, no matter how long that is. --------------040001070200050902010508 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs --------------040001070200050902010508--