Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-11 Thread Alvaro Herrera
On 2021-Jun-04, Greg Nancarrow wrote: > On Thu, Jun 3, 2021 at 1:49 AM Matthias van de Meent > wrote: > > > > On Wed, 2 Jun 2021 at 17:42, Tomas Vondra > > wrote: > > > > > > Nice. I gave it a try on the database I'm experimenting with, and it > > > seems to be working fine. Please add it to th

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-09 Thread Alvaro Herrera
On 2021-Jun-04, Greg Nancarrow wrote: > I tested with and without the patch, using the latest PG14 source as > of today, and can confirm that without the patch applied, the "sorting > live tuples" phase is not reported in the parallel-case, but with the > patch applied it then does get reported in

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-04 Thread Greg Nancarrow
On Fri, Jun 4, 2021 at 5:25 PM Greg Nancarrow wrote: > > What is slightly puzzling to me (and perhaps digging deeper will > reveal it) is why this "sorting live tuples" phase seems so short in > the serial case compared to the parallel case? > For example, in my test I created an index on a column

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-04 Thread Greg Nancarrow
On Thu, Jun 3, 2021 at 1:49 AM Matthias van de Meent wrote: > > On Wed, 2 Jun 2021 at 17:42, Tomas Vondra > wrote: > > > > Nice. I gave it a try on the database I'm experimenting with, and it > > seems to be working fine. Please add it to the next CF. > > Thanks, cf available here: https://commi

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Alvaro Herrera
On 2021-Jun-02, Tomas Vondra wrote: > On 6/2/21 6:38 PM, Alvaro Herrera wrote: > > Hmm, that's odd. I distinctly recall testing the behavior with parallel > > workers, and it is mentioned by Rahila in the original thread, and I > > think we tried to ensure that it was sane. I am surprised to le

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Tomas Vondra
On 6/2/21 6:38 PM, Alvaro Herrera wrote: > On 2021-Jun-02, Tomas Vondra wrote: > >> Hi, >> >> While experimenting with parallel index builds, I've noticed a somewhat >> strange behavior of pg_stat_progress_create_index when a btree index is >> built with parallel workers - some of the phases se

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Alvaro Herrera
On 2021-Jun-02, Tomas Vondra wrote: > Hi, > > While experimenting with parallel index builds, I've noticed a somewhat > strange behavior of pg_stat_progress_create_index when a btree index is > built with parallel workers - some of the phases seem to be missing. Hmm, that's odd. I distinctly re

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Matthias van de Meent
On Wed, 2 Jun 2021 at 17:42, Tomas Vondra wrote: > > On 6/2/21 4:54 PM, Matthias van de Meent wrote: > > On Wed, 2 Jun 2021 at 15:23, Tomas Vondra > > wrote: > >> > >> ... > >> > > > > After looking at it a bit more, it seems like a solution was actually > > easier than I'd expected. PFA a prot

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Tomas Vondra
On 6/2/21 4:54 PM, Matthias van de Meent wrote: On Wed, 2 Jun 2021 at 15:23, Tomas Vondra wrote: ... > After looking at it a bit more, it seems like a solution was actually easier than I'd expected. PFA a prototype (unvalidated, but check-world -ed) patch that would add these subphases of p

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Matthias van de Meent
On Wed, 2 Jun 2021 at 15:23, Tomas Vondra wrote: > > > > On 6/2/21 3:03 PM, Matthias van de Meent wrote: > > On Wed, 2 Jun 2021 at 13:57, Tomas Vondra > > wrote: > >> > >> Hi, > >> > >> While experimenting with parallel index builds, I've noticed a somewhat > >> strange behavior of pg_stat_progr

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Tomas Vondra
On 6/2/21 3:03 PM, Matthias van de Meent wrote: On Wed, 2 Jun 2021 at 13:57, Tomas Vondra wrote: Hi, While experimenting with parallel index builds, I've noticed a somewhat strange behavior of pg_stat_progress_create_index when a btree index is built with parallel workers - some of the pha

Re: pg_stat_progress_create_index vs. parallel index builds

2021-06-02 Thread Matthias van de Meent
On Wed, 2 Jun 2021 at 13:57, Tomas Vondra wrote: > > Hi, > > While experimenting with parallel index builds, I've noticed a somewhat > strange behavior of pg_stat_progress_create_index when a btree index is > built with parallel workers - some of the phases seem to be missing. > > In serial (no pa