Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-25 Thread Tom Lane
Noah Misch writes: > Each elog(FATAL) check deserves a STATEMENT field if it fires, so I think that > would be too early to clear. Here's an version fixing the defects. In > worker_spi_main(), the timing now mirrors postgres.c. initialize_worker_spi() > is doing something not directly possible

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-25 Thread Noah Misch
On Sun, Oct 25, 2020 at 10:52:50AM -0400, Tom Lane wrote: > Noah Misch writes: > > On Sat, Oct 17, 2020 at 08:39:35AM -0700, Peter Geoghegan wrote: > >> I also prefer 2. > > > Thanks. Here is the pair of patches I plan to use. The second is > > equivalent > > to v0; I just added a log message.

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-25 Thread Tom Lane
Noah Misch writes: > On Sat, Oct 17, 2020 at 08:39:35AM -0700, Peter Geoghegan wrote: >> I also prefer 2. > Thanks. Here is the pair of patches I plan to use. The second is equivalent > to v0; I just added a log message. The change in worker_spi_main seems a little weird/lazy. I'd be inclined

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-24 Thread Noah Misch
On Sat, Oct 17, 2020 at 08:39:35AM -0700, Peter Geoghegan wrote: > On Tue, Oct 13, 2020 at 7:26 PM Noah Misch wrote: > > 1. Disable parallelism for the index build under ExecuteTruncateGuts(). > >Nobody will mourn a performance loss from declining parallelism for an > >empty index, but I f

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-17 Thread Peter Geoghegan
On Tue, Oct 13, 2020 at 7:26 PM Noah Misch wrote: > 1. Disable parallelism for the index build under ExecuteTruncateGuts(). >Nobody will mourn a performance loss from declining parallelism for an >empty index, but I feel like this is fixing in the wrong place. > 2. Make _bt_begin_parallel(

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2020-10-13 Thread Noah Misch
On Wed, Mar 07, 2018 at 05:53:18PM -0800, Peter Geoghegan wrote: > On Thu, Mar 1, 2018 at 2:47 PM, Peter Geoghegan wrote: > > No. Just an oversight. Looks like _bt_parallel_build_main() should > > call pgstat_report_activity(), just like ParallelQueryMain(). > > > > I'll come up with a patch soon.

RE: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2018-03-29 Thread Phil Florent
(was: Parallel index creation & pg_stat_activity) On Wed, Mar 7, 2018 at 8:53 PM, Peter Geoghegan wrote: > On Thu, Mar 1, 2018 at 2:47 PM, Peter Geoghegan wrote: >> No. Just an oversight. Looks like _bt_parallel_build_main() should >> call pgstat_report_activity(), just lik

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2018-03-22 Thread Robert Haas
On Wed, Mar 7, 2018 at 8:53 PM, Peter Geoghegan wrote: > On Thu, Mar 1, 2018 at 2:47 PM, Peter Geoghegan wrote: >> No. Just an oversight. Looks like _bt_parallel_build_main() should >> call pgstat_report_activity(), just like ParallelQueryMain(). >> >> I'll come up with a patch soon. > > Attached

Re: pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2018-03-07 Thread Peter Geoghegan
On Thu, Mar 1, 2018 at 2:47 PM, Peter Geoghegan wrote: > No. Just an oversight. Looks like _bt_parallel_build_main() should > call pgstat_report_activity(), just like ParallelQueryMain(). > > I'll come up with a patch soon. Attached patch has parallel CREATE INDEX propagate debug_query_string to

pgstat_report_activity() and parallel CREATE INDEX (was: Parallel index creation & pg_stat_activity)

2018-03-01 Thread Peter Geoghegan
On Wed, Feb 28, 2018 at 9:44 AM, Andres Freund wrote: > Looks like we're not doing a pgstat_report_activity() in the workers? > Any argument for not doing so? No. Just an oversight. Looks like _bt_parallel_build_main() should call pgstat_report_activity(), just like ParallelQueryMain(). I'll com

Re: Parallel index creation & pg_stat_activity

2018-02-28 Thread Andres Freund
Hi Peter, On 2018-02-28 16:50:44 +, Phil Florent wrote: > With an index creation (create index t1_i1 on t1(c1, c2);) I have this kind > of output : > > ./t -d 20 -o "pid, backend_type, query, wait_event_type, wait_event" > busy_pc | distinct_exe | pid | backend_type | query