Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIslL-00HFN9-LE for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 17:02:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tIslH-001MeA-Qq for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Dec 2024 17:02:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIslG-001Mdp-RM for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2024 17:02:04 +0000 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIslA-0012q6-Aa for pgsql-hackers@lists.postgresql.org; Wed, 04 Dec 2024 17:02:03 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.stl.internal (Postfix) with ESMTP id D5BC82540176; Wed, 4 Dec 2024 12:01:53 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 04 Dec 2024 12:01:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1733331713; x=1733418113; bh=k EGFwokKHJdL7P7bRLyqtMaf3NYhZl6cj2dm6bgoynM=; b=ycu8sS8WQWdSZuUmN NIPNY/qMvYfl9fbsE7p6L0CB4tcF3nrit61V+tHBQ1bTNz9SFSQHzyy2yEMSLf3v tmgdC7GcoSsI3ocRc/uJUcSL21NkNi+kZWVlL8xlgj7x6yrERO26MfEdI8LkypT3 ieg8q0ETDDxFSJ2mhZxAzy6r+dQ7dEYpEcefbbymt7l8FihJYpE7ruEdPdpCsPHu tdwG46+ihpqnB3/5wpoeIkxaD3rfDV8NWWhNVHo9KUbwAF6VVedC303dAG20pnqg 6AS0mATp3l2ThkbSlxr1Y2IFoiv6XmtZXpeArLTMxac9Z01UUe3SXXtKn80Mr/Ma OeE2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieehgdelvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecu hfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrd hnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfej jefhgfeiueeukeejkeffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprh hishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdpnhgspghrtg hpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprhgvshhhkhgvkhhi rhhilhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsh eslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 Dec 2024 12:01:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1733331707; bh=SL860nyhMltbAThMxMV6W1xuCJ/pFfLVq6n7+qPURQM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Wyb1H+8uHGROo0XACvSHWVBbsP+7infoUALuAM/gRSnjQ17A9uiDQmK5jS3iaEE+6 7uN6/LgIq7Si0d95GXONDMWTIG8iB9urJM4Hh2TgCFO935S2ncYvQ7rOchP28Ob9hR sh8Ze6gZD6IrnjxFb08p6vpYlr3SsLeHRsZJgHKbDZC2f4oD76Ylf0Jh2aA8n5H3lh hlxBzFskJUQqguvcKtSHcTQI0tr1JVDqgoMi2/Wr+fhynFnTc1HBFMZl6YPOde/Lj2 mYqhxDoDFpIfo53ix41f6oJo2rFWpvHkpaCRMkfuJiuEh1FfLuy7BhL1WXgrR4GFQi lVwtOLYbRDDmw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 2BA7B95; Wed, 4 Dec 2024 18:01:47 +0100 (CET) Date: Wed, 4 Dec 2024 18:01:47 +0100 From: Alvaro Herrera To: Kirill Reshke Cc: PostgreSQL Hackers Subject: Re: Add pg_stat_progress_rewrite view. Message-ID: <202412041701.xp7ha4k5du6u@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, On 2024-Dec-04, Kirill Reshke wrote: > Recently, one administrator asked me how to monitor the progress of > his ALTER TABLE... ALTER COLUMN TYPE bigint. > > That leads me to believe that consumers might benefit from having an > API to track the table change process. I agree that tracking progress of a table rewrite is useful, so +1 for the feature in general. > PFA draft patch adding number of tuples (tuples_processed) that was > read from the altered table. I'm not sure that this is very usable though, because the user would have to know how many tuples the table originally had before they can make any sense of this number. Maybe in addition to that number, we can show the total number of pages of the old relation as well as the number of pages scanned so far. That way, the user knows what fraction of the old table has already been scanned. In addition, but I'm not sure sure aobut this one, it may also be useful to show the number of pages written in the new relation. (It lets you see how better packed the new copy is.) Do we also need to show metrics about the associated toast table? There's no concept of "how many pages we've scanned" for the toast table, but we could say how many pages the old one has vs. how many we've written in the new one so far. Though, again, that may not say a lot. On the other hand, IIRC we also create indexes after the heap rewrite itself is complete, so we should show the progress of that part of the process as well. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La persona que no quería pecar / estaba obligada a sentarse en duras y empinadas sillas / desprovistas, por cierto de blandos atenuantes" (Patricio Vogel)