Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSEm2-0001AC-Cm for pgsql-general@arkaria.postgresql.org; Thu, 29 Nov 2018 05:22:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gSEm0-0005Ih-PT for pgsql-general@arkaria.postgresql.org; Thu, 29 Nov 2018 05:22:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSElz-0005IY-7B for pgsql-general@lists.postgresql.org; Thu, 29 Nov 2018 05:22:00 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gSElq-0002t3-Eq for pgsql-general@postgresql.org; Thu, 29 Nov 2018 05:21:58 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 76B65102E; Thu, 29 Nov 2018 00:21:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 29 Nov 2018 00:21:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=m U8KC/ClUHJzTkNbjg1QZDiitfsaRZGJHCaHSEygfpw=; b=GeUQjaUt9dUvNGEmN LQhVCUGvrVNWSXo1yScUNCT0+mYs6npHoMo/8Wc4JOdQngqzhez0XR4jDllBKl2N EFP4qF8oKDa3DcXtNBXr/mRYj5jH8TFfKWguwyHrY73gSKmjV33cLO02fsQD4kF2 WnZ4Gs3D+nQU2/lZuEpD5T/BbCnHTOdm/FnAKKxD7ckZw7pmnS4Fi0ox4aiZgJgv m6yTupDLOI0JDM2+LIn5ejGDcNURkUtF5mQ9HxatjtJvXFSRXRJbCBPeWKJydrJ2 6RDKDgVJ/AZ41t5tXLrYN64VV+vJy44Ps4i0dTdfPJsfHwVfltALhdHpV8iihF+n JR+JA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=mU8KC/ClUHJzTkNbjg1QZDiitfsaRZGJHCaHSEygf pw=; b=SGB6v7LiV6K8c4ie7tw3lvaqKzmfY95Q3nRp1gT4Doiy60Q8F7BBn8elS dn3YiK7s2jmlwFXQWGoXtSacaIpUZ7MRnnnzjNXPAqV9QLmxvlvNu4F1uIGwIqOW J63/cfcVBNbSDsc1xe+0agpQYlElYaeW6oIF2AMSt1UEaeiVL2RK0hVVfHBmK5+b jm/z+ueZdxvN45nP3fXtQqyB2LvhAPm5mVKQ7ey3I9qnqRuNp1u1g5S9AJJaUwE6 VaL9NfzeTohCjXVPF886PbhE5httOLN6eBf2yUG0xqgBVWqiCSKRRp6o2LiKyE1P N6oTvXpvaIiZOb2DObh4pYKsdB8vw== X-ME-Sender: X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 24F87104A5; Thu, 29 Nov 2018 00:21:45 -0500 (EST) Subject: Re: The age() of a column? To: Ron , pgsql-general@postgresql.org References: <5e967a88-1054-5559-0712-44ef00b6b7c1@gmail.com> From: Adrian Klaver Message-ID: <455f39d1-fe8f-815a-1b42-780cf79e8aa2@aklaver.com> Date: Wed, 28 Nov 2018 21:21:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <5e967a88-1054-5559-0712-44ef00b6b7c1@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/28/18 7:32 PM, Ron wrote: > What does it mean, and where is it documented?  The only place in the https://www.postgresql.org/docs/10/routine-vacuuming.html "The age column measures the number of transactions from the cutoff XID to the current transaction's XID." > docs I see reference to age() is > https://www.postgresql.org/docs/9.6/functions-datetime.html and this > doesn't seem to fit that use case. > > Thanks > > TAPb=# select COALESCE(ta.schemaname, 'pg_toast') || '.' || cl.relname, >        cl.relfrozenxid, >        age(cl.relfrozenxid) > from pg_class cl FULL JOIN pg_tables ta >     ON ta.tablename = cl.relname > where not cl.relfrozenxid = xid '0' >   --and age(cl.relfrozenxid) > 4000000 > order by 1 > limit 30; >            ?column?            | relfrozenxid |   age > -------------------------------+--------------+--------- > cds.ach_return_batch           |     58569152 | 2111005 > cds.ach_return_detail          |     58569152 | 2111005 > cds.all_day_event              |     58569152 | 2111005 > cds.all_day_event_trigger      |     58569152 | 2111005 > [snip] > cds.bank_ftp                   |     58569152 | 2111005 > cds.bank_health_care_job       |     58569152 | 2111005 > cds.bank_inbound_file          |     58569152 | 2111005 > cds.bank_input_format          |     58569152 | 2111005 > (30 rows) > > -- Adrian Klaver adrian.klaver@aklaver.com