Re: pg_stat_progress_create_index vs. parallel index builds - Mailing list pgsql-hackers

From Greg Nancarrow
Subject Re: pg_stat_progress_create_index vs. parallel index builds
Date
Msg-id CAJcOf-dSZAjnvjQUjniEa+aA7k6ed-fOmafjvaQd5Djw1NN3Ow@mail.gmail.com
Whole thread Raw
In response to Re: pg_stat_progress_create_index vs. parallel index builds  (Greg Nancarrow <gregn4422@gmail.com>)
List pgsql-hackers
On Fri, Jun 4, 2021 at 5:25 PM Greg Nancarrow <gregn4422@gmail.com> 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 of a table
> having 10 million records, and it took about 40 seconds, during which
> the "sorting live tuples" phase seemed to take about 8 seconds. Yet
> for the serial case, index creation took about 75 seconds, during
> which the "sorting live tuples" phase seemed to take about 1 second.
>

Seems to be because in the serial case, the sort occurs after the scan
is complete (obviously) but in the parallel case, the scan and sort
are combined, so (after patch application) a portion of the then
reported "sorting live tuples" phase is actually "scanning table".

Regards,
Greg Nancarrow
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Failures with gcd functions with GCC snapshots GCC and -O3 (?)
Next
From: "Joel Jacobson"
Date:
Subject: Re: security_definer_search_path GUC