Re: 28.4.4. Progress Reporting phase status

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: eve(dot)fritz(at)qonto(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: 28.4.4. Progress Reporting phase status
Date: 2024-06-03 20:15:25
Message-ID: 0754dc58-c0b9-4193-a48a-ca031da37147@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
EDB https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message vignesh C 2024-06-04 05:39:35 Re: Ambiguous description on new columns
Previous Message Laurenz Albe 2024-05-31 08:24:36 Re: Avoid too prominent use of "backup" on pg_dump man page