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 1sEE64-000Ji2-5C for pgsql-docs@arkaria.postgresql.org; Mon, 03 Jun 2024 20:16:02 +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 1sEE63-00Cgqg-T2 for pgsql-docs@arkaria.postgresql.org; Mon, 03 Jun 2024 20:15:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEE62-00CgqX-DI for pgsql-docs@lists.postgresql.org; Mon, 03 Jun 2024 20:15:59 +0000 Received: from wfout2-smtp.messagingengine.com ([64.147.123.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEE5z-003IYg-9V for pgsql-docs@lists.postgresql.org; Mon, 03 Jun 2024 20:15:57 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.west.internal (Postfix) with ESMTP id 23D2A1C00152; Mon, 3 Jun 2024 16:15:53 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute2.internal (MEProxy); Mon, 03 Jun 2024 16:15:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1717445752; x=1717532152; bh=In/Dqp+fFA G8E5LkoOgcDt9hsYsQXK7oaRurFPhoVsw=; b=m9YVNkdGR6y5UVtCvGAuOQRtXl v74YpK/vBtHKQpeZbZNkHfgUt+v/uVqwxXt6pTMBN2n+PwvhYn7Z+rzDVpO4qHLC p1XfMCGvDX8GoaOMzhe6lRqkzHROaIM2FBbNnWeVmFlTR1TFtJSqn9bAUqB1zt0P D5Y537JPLSeFyAXfmO5rKZAuCjVwWNHJuNaeDBghx1nB55oayiTLKqYvgM/lIFkp MoZW5Nh9i/3sWrWub5/qD+8LBoecA0JLV7nvNXCq0JiT/OAQXOO3oAPhFHaSkuE+ hoPkoDxUNhI97vFDrkb1ydAhnGUs0IJE+ZMZWpQjff5036wzuCsEsMbVIQdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717445752; x=1717532152; bh=In/Dqp+fFAG8E5LkoOgcDt9hsYsQ XK7oaRurFPhoVsw=; b=V06ggpZCOwN2dsIpIWGQsSKt07APPIe0k/pi1LKDluC6 K6RBkAebeMq9nI/N6gMMkZFpwe/CK24mqRIOI42H3HpI6RN3i3wbsmRV2KwZ+PZP 8ylwd72fs/9bJXAxyuW6dAL+nrUQHAoWRk2cOalbl19aD+Jl/6q+3hQdlVS/SOUV qz7/j8NEBBaC/jeY2U9AqTTkAcJOdIIOiUTt9LgQbJbUMULZf/JNfK3xBE5LgZxn EMeRaKyt/umiDiJDZlMcnlUG5DCTHuEtsA39bgvcmiw6X36yQgB3VECUYO+H6BwV fvw30LrnSJ1e9XeyO0ukQJhPWzRkNNMh4u2ejpo06g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelvddgudegiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrg dtreerreertdenucfhrhhomhepfdfguhhlvghrucfvrghvvghirhgrfdcuoegvuhhlvghr segvuhhlvghrthhordgtohhmqeenucggtffrrghtthgvrhhnpeejtefhuedvgffftdetve dufedtjeeuffekleevkefhveekgeelfefhjeehtdejgeenucffohhmrghinhepvghnthgv rhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepvghulhgvrhesvghulhgvrhhtohdrtghomh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4265D15A0092; Mon, 3 Jun 2024 16:15:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-491-g033e30d24-fm-20240520.001-g033e30d2 MIME-Version: 1.0 Message-Id: <0754dc58-c0b9-4193-a48a-ca031da37147@app.fastmail.com> In-Reply-To: <171708424943.2021730.15027954353131825880@wrigleys.postgresql.org> References: <171708424943.2021730.15027954353131825880@wrigleys.postgresql.org> Date: Mon, 03 Jun 2024 17:15:25 -0300 From: "Euler Taveira" To: eve.fritz@qonto.com, pgsql-docs@lists.postgresql.org Subject: Re: 28.4.4. Progress Reporting phase status Content-Type: multipart/alternative; boundary=9f72c29aabd7443c8533acdcb67d9781 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9f72c29aabd7443c8533acdcb67d9781 Content-Type: text/plain On Thu, May 30, 2024, at 12:50 PM, PG Doc comments form wrote: > I noticed that in "28.4.4. Progress Reporting" chapter for > `pg_stat_progress_create_index`, the "Table 28.43. CREATE INDEX Phases" may > be misleading as phase displayed for "building index" is often more > detailed. > I found in this presentation[1] (slide 20) what seems to be the exact status > displayed by the table while creating the index. > Maybe documentation table displaying all status could be extended to display > the following status: The description is accurate. Since this step (building index) is AM-specific, it shouldn't contain the additional information (after the semicolon). > - building index: initializing [2] > - building index: scanning table > - building index: sorting live tuples > - building index: sorting dead tuples > - building index: loading tuples in tree This is the B-tree build phases. Although, the other access methods (such as Hash, Gin, GiST, BRIN) do not provide a function to report the current building phase, it might be added in the future. I'm not sure if it is worth adding such information here. You can certainly obtain the build phases from all access methods with a query like: WITH amidx AS ( SELECT oid, amname FROM pg_am WHERE amtype = 'i') SELECT a.amname, pg_indexam_progress_phasename(a.oid, i) FROM amidx a, generate_series(0, 100) i WHERE pg_indexam_progress_phasename(a.oid, i) IS NOT NULL ORDER BY a.amname, i; -- Euler Taveira EDB https://www.enterprisedb.com/ --9f72c29aabd7443c8533acdcb67d9781 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Thu, May 30,= 2024, at 12:50 PM, PG Doc comments form wrote:
I noticed that in "28.4.4. Progress= Reporting" chapter for
`pg_stat_progress_create_index`, t= he  "Table 28.43. CREATE INDEX Phases" may
be mislead= ing as phase displayed for "building index" is often more
= detailed. 
I found in this presentation[1] (slide 20)= what seems to be the exact status
displayed by the table = while creating the index. 
Maybe documentation table = displaying all status could be extended to display
the fol= lowing status:

The description= is accurate. Since this step (building index) is AM-specific, it
shouldn't contain the additional information (after the semicolo= n).

- building index: initializing [2]
- building inde= x: scanning table
- building index: sorting live tuples
- building index: sorting dead tuples
- buildi= ng index: loading tuples in tree

This is the B-tree build phases. Although, the other access methods (= such as
Hash, Gin, GiST, BRIN) do not provide a function t= o report the current building
phase, it might be added in = the future. I'm not sure if it is worth adding such
inform= ation here. You can certainly obtain the build phases from all access
methods with a query like:

WITH= amidx AS (
SELECT oid, amname FROM pg_am WHERE amtype =3D= 'i')
SELECT a.amname, pg_indexam_progress_phasename(a.oid= , i)
FROM amidx a, generate_series(0, 100) i
WHERE pg_indexam_progress_phasename(a.oid, i) IS NOT NULL
ORDER BY a.amname, i;


--
Euler Taveira

--9f72c29aabd7443c8533acdcb67d9781--