Re: 28.4.4. Progress Reporting phase status - Mailing list pgsql-docs

From Euler Taveira
Subject Re: 28.4.4. Progress Reporting phase status
Date
Msg-id 0754dc58-c0b9-4193-a48a-ca031da37147@app.fastmail.com
Whole thread Raw
In response to 28.4.4. Progress Reporting phase status  (PG Doc comments form <noreply@postgresql.org>)
Responses Re: 28.4.4. Progress Reporting phase status
List pgsql-docs
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

pgsql-docs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Avoid too prominent use of "backup" on pg_dump man page
Next
From: vignesh C
Date:
Subject: Re: Ambiguous description on new columns