Re: parallel vacuum comments

2021-12-23 Thread Masahiko Sawada
On Fri, Dec 24, 2021 at 11:59 AM Amit Kapila wrote: > > On Thu, Dec 23, 2021 at 10:56 AM Masahiko Sawada > wrote: > > > > On Wed, Dec 22, 2021 at 10:55 PM Amit Kapila > > wrote: > > > > > > On Wed, Dec 22, 2021 at 6:22 PM Amit Kapila > > > wrote: > > > > > > > > On Wed, Dec 22, 2021 at 5:39

Re: parallel vacuum comments

2021-12-23 Thread Amit Kapila
On Thu, Dec 23, 2021 at 10:56 AM Masahiko Sawada wrote: > > On Wed, Dec 22, 2021 at 10:55 PM Amit Kapila wrote: > > > > On Wed, Dec 22, 2021 at 6:22 PM Amit Kapila wrote: > > > > > > On Wed, Dec 22, 2021 at 5:39 PM houzj.f...@fujitsu.com > > > wrote: > > > > > > > > > > > > 2) > > > >

Re: parallel vacuum comments

2021-12-22 Thread Masahiko Sawada
On Wed, Dec 22, 2021 at 10:55 PM Amit Kapila wrote: > > On Wed, Dec 22, 2021 at 6:22 PM Amit Kapila wrote: > > > > On Wed, Dec 22, 2021 at 5:39 PM houzj.f...@fujitsu.com > > wrote: > > > > > > > > > 2) > > > +#include "utils/rel.h" > > > +#include "utils/lsyscache.h" > > > +#include

RE: parallel vacuum comments

2021-12-22 Thread houzj.f...@fujitsu.com
On Wed, Dec 22, 2021 9:55 PM Amit Kapila wrote: > On Wed, Dec 22, 2021 at 6:22 PM Amit Kapila > wrote: > > > > On Wed, Dec 22, 2021 at 5:39 PM houzj.f...@fujitsu.com > > wrote: > > > > > > > > > 2) > > > +#include "utils/rel.h" > > > +#include "utils/lsyscache.h" > > > +#include

Re: parallel vacuum comments

2021-12-22 Thread Amit Kapila
On Wed, Dec 22, 2021 at 6:22 PM Amit Kapila wrote: > > On Wed, Dec 22, 2021 at 5:39 PM houzj.f...@fujitsu.com > wrote: > > > > > > 2) > > +#include "utils/rel.h" > > +#include "utils/lsyscache.h" > > +#include "utils/memutils.h" > > > > It might be better to keep the header file in alphabetical

Re: parallel vacuum comments

2021-12-22 Thread Amit Kapila
On Wed, Dec 22, 2021 at 5:39 PM houzj.f...@fujitsu.com wrote: > > On Wed, Dec 22, 2021 11:36 AM Masahiko Sawada wrote: > > On Tue, Dec 21, 2021 at 10:24 PM Amit Kapila > > wrote: > > The patch looks mostly good to me. > I only have few comments. > > 1) > +/* > + * Do parallel index

RE: parallel vacuum comments

2021-12-22 Thread houzj.f...@fujitsu.com
On Wed, Dec 22, 2021 11:36 AM Masahiko Sawada wrote: > On Tue, Dec 21, 2021 at 10:24 PM Amit Kapila > wrote: > > > > On Tue, Dec 21, 2021 at 11:24 AM Masahiko Sawada > wrote: > > > > > > On Tue, Dec 21, 2021 at 2:04 PM Amit Kapila > wrote: > > > > > > > > > > Thank you for the comment. Agreed.

Re: parallel vacuum comments

2021-12-21 Thread Masahiko Sawada
On Tue, Dec 21, 2021 at 10:24 PM Amit Kapila wrote: > > On Tue, Dec 21, 2021 at 11:24 AM Masahiko Sawada > wrote: > > > > On Tue, Dec 21, 2021 at 2:04 PM Amit Kapila wrote: > > > > > > > Thank you for the comment. Agreed. > > > > I've attached updated version patches. Please review them. > > >

RE: parallel vacuum comments

2021-12-21 Thread houzj.f...@fujitsu.com
On Wed, Dec 22, 2021 8:38 AM Masahiko Sawada wrote: > On Tue, Dec 21, 2021 at 10:24 PM Amit Kapila > wrote: > > > > On Tue, Dec 21, 2021 at 11:24 AM Masahiko Sawada > wrote: > > > > > > On Tue, Dec 21, 2021 at 2:04 PM Amit Kapila > wrote: > > > > > > > > > > Thank you for the comment. Agreed.

Re: parallel vacuum comments

2021-12-21 Thread Masahiko Sawada
On Tue, Dec 21, 2021 at 10:24 PM Amit Kapila wrote: > > On Tue, Dec 21, 2021 at 11:24 AM Masahiko Sawada > wrote: > > > > On Tue, Dec 21, 2021 at 2:04 PM Amit Kapila wrote: > > > > > > > Thank you for the comment. Agreed. > > > > I've attached updated version patches. Please review them. > > >

Re: parallel vacuum comments

2021-12-21 Thread Amit Kapila
On Tue, Dec 21, 2021 at 11:24 AM Masahiko Sawada wrote: > > On Tue, Dec 21, 2021 at 2:04 PM Amit Kapila wrote: > > > > Thank you for the comment. Agreed. > > I've attached updated version patches. Please review them. > These look mostly good to me. Please find attached the slightly edited

Re: parallel vacuum comments

2021-12-20 Thread Masahiko Sawada
On Tue, Dec 21, 2021 at 2:04 PM Amit Kapila wrote: > > On Tue, Dec 21, 2021 at 10:05 AM Masahiko Sawada > wrote: > > > > On Tue, Dec 21, 2021 at 12:05 PM Amit Kapila > > wrote: > > > > > > On Mon, Dec 20, 2021 at 6:29 PM Masahiko Sawada > > > wrote: > > > > > BTW, if we go with that then

Re: parallel vacuum comments

2021-12-20 Thread Amit Kapila
On Tue, Dec 21, 2021 at 10:05 AM Masahiko Sawada wrote: > > On Tue, Dec 21, 2021 at 12:05 PM Amit Kapila wrote: > > > > On Mon, Dec 20, 2021 at 6:29 PM Masahiko Sawada > > wrote: > > > BTW, if we go with that then we should set the correct phase > > for workers as well? > > If we have

Re: parallel vacuum comments

2021-12-20 Thread Masahiko Sawada
On Tue, Dec 21, 2021 at 12:05 PM Amit Kapila wrote: > > On Mon, Dec 20, 2021 at 6:29 PM Masahiko Sawada wrote: > > > > On Mon, Dec 20, 2021 at 1:08 PM Amit Kapila wrote: > > > > > > > > > > > > > 2. What is the reason for not moving > > > > > lazy_vacuum_one_index/lazy_cleanup_one_index to

Re: parallel vacuum comments

2021-12-20 Thread Amit Kapila
On Mon, Dec 20, 2021 at 6:29 PM Masahiko Sawada wrote: > > On Mon, Dec 20, 2021 at 1:08 PM Amit Kapila wrote: > > > > > > > > > > 2. What is the reason for not moving > > > > lazy_vacuum_one_index/lazy_cleanup_one_index to vacuum.c so that they > > > > can be called from vacuumlazy.c and

Re: parallel vacuum comments

2021-12-20 Thread Masahiko Sawada
On Mon, Dec 20, 2021 at 1:08 PM Amit Kapila wrote: > > On Mon, Dec 20, 2021 at 8:33 AM Masahiko Sawada wrote: > > > > On Sat, Dec 18, 2021 at 3:38 PM Amit Kapila wrote: > > > > > > Few comments: > > > = > > > 1. > > > + * dead_items stores TIDs whose index tuples are deleted by

Re: parallel vacuum comments

2021-12-19 Thread Amit Kapila
On Mon, Dec 20, 2021 at 8:33 AM Masahiko Sawada wrote: > > On Sat, Dec 18, 2021 at 3:38 PM Amit Kapila wrote: > > > > Few comments: > > = > > 1. > > + * dead_items stores TIDs whose index tuples are deleted by index > > vacuuming. > > + * Each TID points to an LP_DEAD line pointer

Re: parallel vacuum comments

2021-12-19 Thread Masahiko Sawada
On Sat, Dec 18, 2021 at 3:38 PM Amit Kapila wrote: > > On Fri, Dec 17, 2021 at 10:51 AM Masahiko Sawada > wrote: > > > > I've attached updated patches. The first patch just moves common > > function for index bulk-deletion and cleanup to vacuum.c. And the > > second patch moves parallel vacuum

Re: parallel vacuum comments

2021-12-17 Thread Amit Kapila
On Fri, Dec 17, 2021 at 10:51 AM Masahiko Sawada wrote: > > I've attached updated patches. The first patch just moves common > function for index bulk-deletion and cleanup to vacuum.c. And the > second patch moves parallel vacuum code to vacuumparallel.c. The > comments I got so far are

Re: parallel vacuum comments

2021-12-16 Thread Masahiko Sawada
On Thu, Dec 16, 2021 at 4:27 PM houzj.f...@fujitsu.com wrote: > > On Wed, Dec 15, 2021 4:03 PM Masahiko Sawada wrote: > > On Tue, Dec 14, 2021 at 12:03 PM Amit Kapila > > wrote: > > > There is still pending > > > work related to moving parallel vacuum code to a separate file and a > > > few

Re: parallel vacuum comments

2021-12-16 Thread Masahiko Sawada
On Thu, Dec 16, 2021 at 10:38 PM Amit Kapila wrote: > > On Thu, Dec 16, 2021 at 6:13 PM Masahiko Sawada wrote: > > > > On Thu, Dec 16, 2021 at 1:56 PM Amit Kapila wrote: > > > > > > On Wed, Dec 15, 2021 at 1:33 PM Masahiko Sawada > > > wrote: > > > > > > > > I've attached an updated patch.

Re: parallel vacuum comments

2021-12-16 Thread Amit Kapila
On Thu, Dec 16, 2021 at 6:13 PM Masahiko Sawada wrote: > > On Thu, Dec 16, 2021 at 1:56 PM Amit Kapila wrote: > > > > On Wed, Dec 15, 2021 at 1:33 PM Masahiko Sawada > > wrote: > > > > > > I've attached an updated patch. The patch incorporated several changes > > > from the last version: > > >

Re: parallel vacuum comments

2021-12-16 Thread Masahiko Sawada
On Thu, Dec 16, 2021 at 1:56 PM Amit Kapila wrote: > > On Wed, Dec 15, 2021 at 1:33 PM Masahiko Sawada wrote: > > > > I've attached an updated patch. The patch incorporated several changes > > from the last version: > > > > * Rename parallel_vacuum_begin() to parallel_vacuum_init() > > * Unify

RE: parallel vacuum comments

2021-12-15 Thread houzj.f...@fujitsu.com
On Wed, Dec 15, 2021 4:03 PM Masahiko Sawada wrote: > On Tue, Dec 14, 2021 at 12:03 PM Amit Kapila wrote: > > There is still pending > > work related to moving parallel vacuum code to a separate file and a > > few other pending comments that are still under discussion. We can > > take care of

Re: parallel vacuum comments

2021-12-15 Thread Amit Kapila
On Wed, Dec 15, 2021 at 1:33 PM Masahiko Sawada wrote: > > I've attached an updated patch. The patch incorporated several changes > from the last version: > > * Rename parallel_vacuum_begin() to parallel_vacuum_init() > * Unify the terminology; use "index bulk-deletion" and "index cleanup" >

Re: parallel vacuum comments

2021-12-15 Thread Masahiko Sawada
On Tue, Dec 14, 2021 at 12:03 PM Amit Kapila wrote: > > On Tue, Dec 14, 2021 at 7:40 AM tanghy.f...@fujitsu.com > wrote: > > > > On Monday, December 13, 2021 2:12 PM Masahiko Sawada > > wrote: > > > > > > On Mon, Dec 13, 2021 at 2:09 PM Amit Kapila > > > wrote: > > > > > > > > On Mon, Dec

Re: parallel vacuum comments

2021-12-14 Thread Amit Kapila
On Wed, Dec 15, 2021 at 8:23 AM Peter Geoghegan wrote: > > On Mon, Dec 13, 2021 at 7:03 PM Amit Kapila wrote: > > Thanks, I can take care of this before committing. The v9-0001* looks > > good to me as well, so, I am planning to commit that tomorrow unless I > > see more comments or any

Re: parallel vacuum comments

2021-12-14 Thread Peter Geoghegan
On Mon, Dec 13, 2021 at 7:03 PM Amit Kapila wrote: > Thanks, I can take care of this before committing. The v9-0001* looks > good to me as well, so, I am planning to commit that tomorrow unless I > see more comments or any objection to that. I would like to thank both Masahiko and yourself for

Re: parallel vacuum comments

2021-12-13 Thread Amit Kapila
On Tue, Dec 14, 2021 at 7:40 AM tanghy.f...@fujitsu.com wrote: > > On Monday, December 13, 2021 2:12 PM Masahiko Sawada > wrote: > > > > On Mon, Dec 13, 2021 at 2:09 PM Amit Kapila wrote: > > > > > > On Mon, Dec 13, 2021 at 10:33 AM Masahiko Sawada > > wrote: > > > > > > > > On Fri, Dec 10,

RE: parallel vacuum comments

2021-12-13 Thread houzj.f...@fujitsu.com
On Tuesday, December 14, 2021 10:11 AM Tang, Haiying wrote: > On Monday, December 13, 2021 2:12 PM Masahiko Sawada > wrote: > > I've attached the patch. I've just moved some functions back but not > > done other changes. > > > > Thanks for your patch. > > I tested your patch and tried some

RE: parallel vacuum comments

2021-12-13 Thread tanghy.f...@fujitsu.com
On Monday, December 13, 2021 2:12 PM Masahiko Sawada wrote: > > On Mon, Dec 13, 2021 at 2:09 PM Amit Kapila wrote: > > > > On Mon, Dec 13, 2021 at 10:33 AM Masahiko Sawada > wrote: > > > > > > On Fri, Dec 10, 2021 at 9:08 PM Amit Kapila > wrote: > > > > > > > > On Thu, Dec 9, 2021 at 6:05 PM

Re: parallel vacuum comments

2021-12-12 Thread Masahiko Sawada
On Mon, Dec 13, 2021 at 2:09 PM Amit Kapila wrote: > > On Mon, Dec 13, 2021 at 10:33 AM Masahiko Sawada > wrote: > > > > On Fri, Dec 10, 2021 at 9:08 PM Amit Kapila wrote: > > > > > > On Thu, Dec 9, 2021 at 6:05 PM Masahiko Sawada > > > wrote: > > > > > > > > On Thu, Dec 9, 2021 at 7:44 PM

Re: parallel vacuum comments

2021-12-12 Thread Amit Kapila
On Mon, Dec 13, 2021 at 10:33 AM Masahiko Sawada wrote: > > On Fri, Dec 10, 2021 at 9:08 PM Amit Kapila wrote: > > > > On Thu, Dec 9, 2021 at 6:05 PM Masahiko Sawada > > wrote: > > > > > > On Thu, Dec 9, 2021 at 7:44 PM Amit Kapila > > > wrote: > > > > > > Agreed with the above two points. >

Re: parallel vacuum comments

2021-12-12 Thread Masahiko Sawada
On Fri, Dec 10, 2021 at 9:08 PM Amit Kapila wrote: > > On Thu, Dec 9, 2021 at 6:05 PM Masahiko Sawada wrote: > > > > On Thu, Dec 9, 2021 at 7:44 PM Amit Kapila wrote: > > > > Agreed with the above two points. > > > > I've attached updated patches that incorporated the above comments > > too.

Re: parallel vacuum comments

2021-12-12 Thread Masahiko Sawada
On Mon, Dec 13, 2021 at 12:03 PM Amit Kapila wrote: > > On Sat, Dec 11, 2021 at 8:30 PM Masahiko Sawada wrote: > > > > On Sat, Dec 11, 2021 at 2:32 PM Andres Freund wrote: > > > > > > Hi, > > > > > > On 2021-10-30 14:21:01 -0700, Andres Freund wrote: > > > > Due to bug #17245: [1] I spent a

Re: parallel vacuum comments

2021-12-12 Thread Amit Kapila
On Sat, Dec 11, 2021 at 8:30 PM Masahiko Sawada wrote: > > On Sat, Dec 11, 2021 at 2:32 PM Andres Freund wrote: > > > > Hi, > > > > On 2021-10-30 14:21:01 -0700, Andres Freund wrote: > > > Due to bug #17245: [1] I spent a considerably amount of time looking at > > > vacuum > > > related code.

Re: parallel vacuum comments

2021-12-11 Thread Masahiko Sawada
On Sat, Dec 11, 2021 at 2:32 PM Andres Freund wrote: > > Hi, > > On 2021-10-30 14:21:01 -0700, Andres Freund wrote: > > Due to bug #17245: [1] I spent a considerably amount of time looking at > > vacuum > > related code. And I found a few things that I think could stand improvement: Thank you

Re: parallel vacuum comments

2021-12-10 Thread Andres Freund
Hi, On 2021-10-30 14:21:01 -0700, Andres Freund wrote: > Due to bug #17245: [1] I spent a considerably amount of time looking at vacuum > related code. And I found a few things that I think could stand improvement: While working on the fix for #17255 (more specifically some cleanup that Peter

Re: parallel vacuum comments

2021-12-10 Thread Amit Kapila
On Thu, Dec 9, 2021 at 6:05 PM Masahiko Sawada wrote: > > On Thu, Dec 9, 2021 at 7:44 PM Amit Kapila wrote: > > Agreed with the above two points. > > I've attached updated patches that incorporated the above comments > too. Please review them. > I have made the following minor changes to the

Re: parallel vacuum comments

2021-12-09 Thread Masahiko Sawada
On Thu, Dec 9, 2021 at 7:05 PM Amit Kapila wrote: > > On Mon, Dec 6, 2021 at 10:17 AM Amit Kapila wrote: > > > > On Fri, Dec 3, 2021 at 6:06 PM Masahiko Sawada > > wrote: > > > > > > On Fri, Dec 3, 2021 at 6:03 PM Amit Kapila > > > wrote: > > > > > > > > On Thu, Dec 2, 2021 at 6:01 PM

Re: parallel vacuum comments

2021-12-09 Thread Amit Kapila
On Thu, Dec 9, 2021 at 3:35 PM Amit Kapila wrote: > > On Mon, Dec 6, 2021 at 10:17 AM Amit Kapila wrote: > > > > On Fri, Dec 3, 2021 at 6:06 PM Masahiko Sawada > > wrote: > > > > 2. The patch seems to be calling parallel_vacuum_should_skip_index > > > > thrice even before starting parallel

Re: parallel vacuum comments

2021-12-09 Thread Amit Kapila
On Mon, Dec 6, 2021 at 10:17 AM Amit Kapila wrote: > > On Fri, Dec 3, 2021 at 6:06 PM Masahiko Sawada wrote: > > > > On Fri, Dec 3, 2021 at 6:03 PM Amit Kapila wrote: > > > > > > On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada > > > wrote: > > > > > > > > I've attached updated patches. > > > >

Re: parallel vacuum comments

2021-12-07 Thread Masahiko Sawada
On Wed, Dec 8, 2021 at 12:22 PM houzj.f...@fujitsu.com wrote: > > On Tuesday, December 7, 2021 1:42 PM Masahiko Sawada > wrote: > > I've attached an updated patch. I've removed 0003 patch that added > > regression tests as per discussion. Regarding the terminology like "bulkdel" > > and

RE: parallel vacuum comments

2021-12-07 Thread houzj.f...@fujitsu.com
On Tuesday, December 7, 2021 1:42 PM Masahiko Sawada wrote: > I've attached an updated patch. I've removed 0003 patch that added > regression tests as per discussion. Regarding the terminology like "bulkdel" > and "cleanup" you pointed out, I've done that in 0002 patch while moving the > code to

Re: parallel vacuum comments

2021-12-06 Thread Amit Kapila
On Tue, Dec 7, 2021 at 6:54 AM Masahiko Sawada wrote: > > On Mon, Dec 6, 2021 at 1:47 PM Amit Kapila wrote: > > > > On Fri, Dec 3, 2021 at 6:06 PM Masahiko Sawada > > wrote: > > > > > > > > > > > 3. /* > > > > * Copy the index bulk-deletion result returned from ambulkdelete and > > > > @@

Re: parallel vacuum comments

2021-12-06 Thread Masahiko Sawada
On Mon, Dec 6, 2021 at 1:47 PM Amit Kapila wrote: > > On Fri, Dec 3, 2021 at 6:06 PM Masahiko Sawada wrote: > > > > On Fri, Dec 3, 2021 at 6:03 PM Amit Kapila wrote: > > > > > > On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada > > > wrote: > > > > > > > > I've attached updated patches. > > > >

Re: parallel vacuum comments

2021-12-05 Thread Amit Kapila
On Fri, Dec 3, 2021 at 6:06 PM Masahiko Sawada wrote: > > On Fri, Dec 3, 2021 at 6:03 PM Amit Kapila wrote: > > > > On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada > > wrote: > > > > > > I've attached updated patches. > > > > > > > I have a few comments on v4-0001. > > Thank you for the

Re: parallel vacuum comments

2021-12-03 Thread Masahiko Sawada
On Fri, Dec 3, 2021 at 6:03 PM Amit Kapila wrote: > > On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada wrote: > > > > I've attached updated patches. > > > > I have a few comments on v4-0001. Thank you for the comments! > 1. > In parallel_vacuum_process_all_indexes(), we can combine the two >

Re: parallel vacuum comments

2021-12-03 Thread Masahiko Sawada
and On Fri, Dec 3, 2021 at 6:56 PM Amit Kapila wrote: > > On Fri, Dec 3, 2021 at 2:33 PM Amit Kapila wrote: > > > > On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada > > wrote: > > > > > > I've attached updated patches. > > > > > > > I have a few comments on v4-0001. > > > > The new test

Re: parallel vacuum comments

2021-12-03 Thread Amit Kapila
On Fri, Dec 3, 2021 at 2:33 PM Amit Kapila wrote: > > On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada wrote: > > > > I've attached updated patches. > > > > I have a few comments on v4-0001. > The new test proposed by v4-0003 is increasing the vacuum_parallel.sql timing by more than 10 times. It

Re: parallel vacuum comments

2021-12-03 Thread Amit Kapila
On Fri, Dec 3, 2021 at 3:01 PM houzj.f...@fujitsu.com wrote: > > On Thur, Dec 2, 2021 8:31 PM Masahiko Sawada wrote: > > I've attached updated patches. > > > > The first patch is the main patch for refactoring parallel vacuum code; > > removes > > bitmap-related code and renames function names

RE: parallel vacuum comments

2021-12-03 Thread houzj.f...@fujitsu.com
On Thur, Dec 2, 2021 8:31 PM Masahiko Sawada wrote: > I've attached updated patches. > > The first patch is the main patch for refactoring parallel vacuum code; > removes > bitmap-related code and renames function names for consistency. The second > patch moves these parallel-related codes to

Re: parallel vacuum comments

2021-12-03 Thread Amit Kapila
On Thu, Dec 2, 2021 at 6:01 PM Masahiko Sawada wrote: > > I've attached updated patches. > I have a few comments on v4-0001. 1. In parallel_vacuum_process_all_indexes(), we can combine the two checks for vacuum/cleanup at the beginning of the function and I think it is better to keep the

Re: parallel vacuum comments

2021-11-29 Thread Masahiko Sawada
On Tue, Nov 30, 2021 at 3:00 PM Amit Kapila wrote: > > On Tue, Nov 30, 2021 at 11:03 AM houzj.f...@fujitsu.com > wrote: > > > > On Mon, Nov 29, 2021 11:38 AM Masahiko Sawada wrote: > > > > > > > 2) > > + /* Reinitialize the parallel context to relaunch parallel > > workers */ > >

Re: parallel vacuum comments

2021-11-29 Thread Amit Kapila
On Tue, Nov 30, 2021 at 11:03 AM houzj.f...@fujitsu.com wrote: > > On Mon, Nov 29, 2021 11:38 AM Masahiko Sawada wrote: > > > > 2) > + /* Reinitialize the parallel context to relaunch parallel > workers */ > + if (!pvs->first_time) > > It seems the

RE: parallel vacuum comments

2021-11-29 Thread houzj.f...@fujitsu.com
On Mon, Nov 29, 2021 11:38 AM Masahiko Sawada wrote: > > Maybe we can start with using parallel_vacuum_*. We can change them > later if there is an argument. > > I've attached an updated patch. I don't update the terminology in > vacuum that we're discussing on another thread[1]. Hi, I

Re: parallel vacuum comments

2021-11-28 Thread Masahiko Sawada
On Wed, Nov 24, 2021 at 5:54 PM Amit Kapila wrote: > > On Wed, Nov 24, 2021 at 12:16 PM Masahiko Sawada > wrote: > > > > On Wed, Nov 24, 2021 at 1:34 PM Amit Kapila wrote: > > > > > > On Wed, Nov 24, 2021 at 7:43 AM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, Nov 22, 2021 at 1:48 PM

Re: parallel vacuum comments

2021-11-24 Thread Amit Kapila
On Wed, Nov 24, 2021 at 12:16 PM Masahiko Sawada wrote: > > On Wed, Nov 24, 2021 at 1:34 PM Amit Kapila wrote: > > > > On Wed, Nov 24, 2021 at 7:43 AM Masahiko Sawada > > wrote: > > > > > > On Mon, Nov 22, 2021 at 1:48 PM Amit Kapila > > > wrote: > > > > > > > > On Fri, Nov 19, 2021 at 7:55

Re: parallel vacuum comments

2021-11-23 Thread Masahiko Sawada
On Wed, Nov 24, 2021 at 1:34 PM Amit Kapila wrote: > > On Wed, Nov 24, 2021 at 7:43 AM Masahiko Sawada wrote: > > > > On Mon, Nov 22, 2021 at 1:48 PM Amit Kapila wrote: > > > > > > On Fri, Nov 19, 2021 at 7:55 AM houzj.f...@fujitsu.com > > > wrote: > > > > > > > > > > > 4) > > > > > > > > Just

Re: parallel vacuum comments

2021-11-23 Thread Masahiko Sawada
On Wed, Nov 24, 2021 at 1:28 PM Amit Kapila wrote: > > On Wed, Nov 24, 2021 at 7:07 AM Masahiko Sawada wrote: > > > > On Mon, Nov 22, 2021 at 6:35 PM Amit Kapila wrote: > > > > > > On Tue, Nov 16, 2021 at 11:23 AM Masahiko Sawada > > > wrote: > > > > > > > > I've incorporated these comments

Re: parallel vacuum comments

2021-11-23 Thread Amit Kapila
On Wed, Nov 24, 2021 at 7:43 AM Masahiko Sawada wrote: > > On Mon, Nov 22, 2021 at 1:48 PM Amit Kapila wrote: > > > > On Fri, Nov 19, 2021 at 7:55 AM houzj.f...@fujitsu.com > > wrote: > > > > > > > > 4) > > > > > > Just a personal suggestion for the parallel related function name. Since > > >

Re: parallel vacuum comments

2021-11-23 Thread Amit Kapila
On Wed, Nov 24, 2021 at 7:07 AM Masahiko Sawada wrote: > > On Mon, Nov 22, 2021 at 6:35 PM Amit Kapila wrote: > > > > On Tue, Nov 16, 2021 at 11:23 AM Masahiko Sawada > > wrote: > > > > > > I've incorporated these comments and attached an updated patch. > > > > > > > Review comments: > >

Re: parallel vacuum comments

2021-11-23 Thread Amit Kapila
On Wed, Nov 24, 2021 at 7:48 AM Masahiko Sawada wrote: > > On Fri, Nov 19, 2021 at 11:25 AM houzj.f...@fujitsu.com > wrote: > > > > 3) > > > > + /* > > +* Reset all index status back to invalid (while checking that we > > have > > +* processed all indexes). > > +*/

Re: parallel vacuum comments

2021-11-23 Thread Masahiko Sawada
On Fri, Nov 19, 2021 at 11:25 AM houzj.f...@fujitsu.com wrote: > > On Tues, Nov 16, 2021 1:53 PM Masahiko Sawada wrote: > > I've incorporated these comments and attached an updated patch. > > Thanks for updating the patch. > I read the latest patch and have few comments. Thank you for the

Re: parallel vacuum comments

2021-11-23 Thread Masahiko Sawada
On Mon, Nov 22, 2021 at 1:48 PM Amit Kapila wrote: > > On Fri, Nov 19, 2021 at 7:55 AM houzj.f...@fujitsu.com > wrote: > > > > On Tues, Nov 16, 2021 1:53 PM Masahiko Sawada wrote: > > > I've incorporated these comments and attached an updated patch. > > > > > > 2) > > static void

Re: parallel vacuum comments

2021-11-23 Thread Masahiko Sawada
On Mon, Nov 22, 2021 at 6:35 PM Amit Kapila wrote: > > On Tue, Nov 16, 2021 at 11:23 AM Masahiko Sawada > wrote: > > > > I've incorporated these comments and attached an updated patch. > > > > Review comments: > > 1. > index_can_participate_parallel_vacuum() > { > .. > + /* > +

Re: parallel vacuum comments

2021-11-22 Thread Amit Kapila
On Tue, Nov 16, 2021 at 11:23 AM Masahiko Sawada wrote: > > I've incorporated these comments and attached an updated patch. > Review comments: 1. index_can_participate_parallel_vacuum() { .. + /* + * Not safe, if the index supports parallel cleanup conditionally, + * but we have

Re: parallel vacuum comments

2021-11-21 Thread Amit Kapila
On Fri, Nov 19, 2021 at 7:55 AM houzj.f...@fujitsu.com wrote: > > On Tues, Nov 16, 2021 1:53 PM Masahiko Sawada wrote: > > I've incorporated these comments and attached an updated patch. > > > 2) > static void vacuum_error_callback(void *arg); > > I noticed the patch changed the parallel

RE: parallel vacuum comments

2021-11-18 Thread houzj.f...@fujitsu.com
On Tues, Nov 16, 2021 1:53 PM Masahiko Sawada wrote: > I've incorporated these comments and attached an updated patch. Thanks for updating the patch. I read the latest patch and have few comments. 1) +/* + * lazy_vacuum_one_index() -- vacuum index relation. ... +IndexBulkDeleteResult *

Re: parallel vacuum comments

2021-11-15 Thread Masahiko Sawada
On Tue, Nov 16, 2021 at 11:38 AM houzj.f...@fujitsu.com wrote: > > On Thur, Nov 11, 2021 10:41 AM Masahiko Sawada wrote: > > I've attached a draft patch that refactors parallel vacuum and separates > > parallel-vacuum-related code to new file vacuumparallel.c. > > After discussion, I'll divide

RE: parallel vacuum comments

2021-11-15 Thread houzj.f...@fujitsu.com
On Thur, Nov 11, 2021 10:41 AM Masahiko Sawada wrote: > I've attached a draft patch that refactors parallel vacuum and separates > parallel-vacuum-related code to new file vacuumparallel.c. > After discussion, I'll divide the patch into logical chunks. Hi. I noticed few minor issues in the

Re: parallel vacuum comments

2021-11-15 Thread Masahiko Sawada
On Mon, Nov 15, 2021 at 8:04 PM Amit Kapila wrote: > > On Mon, Nov 15, 2021 at 2:01 PM Masahiko Sawada wrote: > > > > On Thu, Nov 11, 2021 at 6:38 PM Amit Kapila wrote: > > > > > > On Thu, Nov 11, 2021 at 8:11 AM Masahiko Sawada > > > wrote: > > > > > > > > I've attached a draft patch that

Re: parallel vacuum comments

2021-11-15 Thread Amit Kapila
On Mon, Nov 15, 2021 at 2:01 PM Masahiko Sawada wrote: > > On Thu, Nov 11, 2021 at 6:38 PM Amit Kapila wrote: > > > > On Thu, Nov 11, 2021 at 8:11 AM Masahiko Sawada > > wrote: > > > > > > I've attached a draft patch that refactors parallel vacuum and > > > separates parallel-vacuum-related

Re: parallel vacuum comments

2021-11-15 Thread Masahiko Sawada
On Thu, Nov 11, 2021 at 6:38 PM Amit Kapila wrote: > > On Thu, Nov 11, 2021 at 8:11 AM Masahiko Sawada wrote: > > > > I've attached a draft patch that refactors parallel vacuum and > > separates parallel-vacuum-related code to new file vacuumparallel.c. > > After discussion, I'll divide the

Re: parallel vacuum comments

2021-11-11 Thread Amit Kapila
On Thu, Nov 11, 2021 at 8:11 AM Masahiko Sawada wrote: > > I've attached a draft patch that refactors parallel vacuum and > separates parallel-vacuum-related code to new file vacuumparallel.c. > After discussion, I'll divide the patch into logical chunks. > > What I'm not convinced yet in this

Re: parallel vacuum comments

2021-11-10 Thread Masahiko Sawada
On Tue, Nov 9, 2021 at 9:53 PM Masahiko Sawada wrote: > > On Fri, Nov 5, 2021 at 4:00 AM Andres Freund wrote: > > > > Hi, > > > > On 2021-11-01 10:44:34 +0900, Masahiko Sawada wrote: > > > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > > > But even though we have this space

Re: parallel vacuum comments

2021-11-09 Thread Masahiko Sawada
On Fri, Nov 5, 2021 at 4:00 AM Andres Freund wrote: > > Hi, > > On 2021-11-01 10:44:34 +0900, Masahiko Sawada wrote: > > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > > But even though we have this space optimized bitmap thing, we actually > > > need > > > more memory allocated

Re: parallel vacuum comments

2021-11-04 Thread Masahiko Sawada
On Fri, Nov 5, 2021 at 6:25 AM Peter Geoghegan wrote: > > On Thu, Nov 4, 2021 at 12:42 PM Peter Geoghegan wrote: > > Since "The leader process alone processes all parallel-safe indexes in > > the case where no workers are launched" (no change there), I wonder: > > how does the leader *know* that

Re: parallel vacuum comments

2021-11-04 Thread Masahiko Sawada
On Fri, Nov 5, 2021 at 4:42 AM Peter Geoghegan wrote: > > On Wed, Nov 3, 2021 at 10:25 PM Masahiko Sawada wrote: > > I've attached a draft patch. The patch incorporated all comments from > > Andres except for the last comment that moves parallel related code to > > another file. I'd like to

RE: parallel vacuum comments

2021-11-04 Thread houzj.f...@fujitsu.com
On Thur, Nov 4, 2021 1:25 PM Masahiko Sawada wrote: > On Wed, Nov 3, 2021 at 1:08 PM Amit Kapila wrote: > > > > On Tue, Nov 2, 2021 at 11:17 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Nov 2, 2021 at 5:57 AM Peter Geoghegan wrote: > > > > > > > > > > > Rather than inventing

Re: parallel vacuum comments

2021-11-04 Thread Peter Geoghegan
On Thu, Nov 4, 2021 at 12:42 PM Peter Geoghegan wrote: > Since "The leader process alone processes all parallel-safe indexes in > the case where no workers are launched" (no change there), I wonder: > how does the leader *know* that it's the leader (and so can always > process any indexes) inside

Re: parallel vacuum comments

2021-11-04 Thread Peter Geoghegan
On Wed, Nov 3, 2021 at 10:25 PM Masahiko Sawada wrote: > I've attached a draft patch. The patch incorporated all comments from > Andres except for the last comment that moves parallel related code to > another file. I'd like to discuss how we split vacuumlazy.c. This looks great! I wonder if

Re: parallel vacuum comments

2021-11-04 Thread Andres Freund
Hi, On 2021-11-01 10:44:34 +0900, Masahiko Sawada wrote: > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > But even though we have this space optimized bitmap thing, we actually > > need > > more memory allocated for each index, making this whole thing pointless. > > Right. But is

Re: parallel vacuum comments

2021-11-03 Thread Masahiko Sawada
On Wed, Nov 3, 2021 at 1:08 PM Amit Kapila wrote: > > On Tue, Nov 2, 2021 at 11:17 AM Masahiko Sawada wrote: > > > > On Tue, Nov 2, 2021 at 5:57 AM Peter Geoghegan wrote: > > > > > > > > Rather than inventing PARALLEL_VACUUM_KEY_INDVAC_CHECK (just for > > > assert-enabled builds), we should

Re: parallel vacuum comments

2021-11-02 Thread Amit Kapila
On Tue, Nov 2, 2021 at 11:17 AM Masahiko Sawada wrote: > > On Tue, Nov 2, 2021 at 5:57 AM Peter Geoghegan wrote: > > > > > Rather than inventing PARALLEL_VACUUM_KEY_INDVAC_CHECK (just for > > assert-enabled builds), we should invent PARALLEL_VACUUM_STATS -- a > > dedicated shmem area for the

Re: parallel vacuum comments

2021-11-02 Thread Masahiko Sawada
On Wed, Nov 3, 2021 at 11:53 AM Peter Geoghegan wrote: > > On Tue, Nov 2, 2021 at 7:35 PM Masahiko Sawada wrote: > > It returns true in the above condition but it should return false > > since the index doesn't support parallel index cleanup at all. It > > seems that this bug was introduced by

Re: parallel vacuum comments

2021-11-02 Thread Peter Geoghegan
On Tue, Nov 2, 2021 at 7:35 PM Masahiko Sawada wrote: > It returns true in the above condition but it should return false > since the index doesn't support parallel index cleanup at all. It > seems that this bug was introduced by commit b4af70cb21 (therefore > exists only in PG14) which flipped

Re: parallel vacuum comments

2021-11-02 Thread Masahiko Sawada
On Tue, Nov 2, 2021 at 2:46 PM Masahiko Sawada wrote: > > Anyway, I'll write a patch accordingly. While writing a patch for these comments, I found another bug in parallel_processing_is_safe(): /* * Returns false, if the given index can't participate in parallel index * vacuum or parallel

Re: parallel vacuum comments

2021-11-02 Thread Amit Kapila
On Mon, Nov 1, 2021 at 7:15 AM Masahiko Sawada wrote: > > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > > - Imo it's pretty confusing to have functions like > > lazy_parallel_vacuum_indexes() (in 13, renamed in 14) that "Perform index > > vacuum or index cleanup with parallel

Re: parallel vacuum comments

2021-11-01 Thread Masahiko Sawada
On Tue, Nov 2, 2021 at 5:57 AM Peter Geoghegan wrote: > > On Mon, Nov 1, 2021 at 5:47 AM Masahiko Sawada wrote: > > For discussion, I've written a patch only for adding some tests to > > parallel vacuum. The test includes the reported case where small > > indexes are not processed by the leader

Re: parallel vacuum comments

2021-11-01 Thread Peter Geoghegan
On Mon, Nov 1, 2021 at 5:47 AM Masahiko Sawada wrote: > For discussion, I've written a patch only for adding some tests to > parallel vacuum. The test includes the reported case where small > indexes are not processed by the leader process as well as cases where > different kinds of indexes

Re: parallel vacuum comments

2021-11-01 Thread Masahiko Sawada
On Mon, Nov 1, 2021 at 10:44 AM Masahiko Sawada wrote: > > On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > > > Hi, > > > > Due to bug #17245: [1] I spent a considerably amount of time looking at > > vacuum > > related code. And I found a few things that I think could stand improvement:

Re: parallel vacuum comments

2021-10-31 Thread Masahiko Sawada
On Sun, Oct 31, 2021 at 6:21 AM Andres Freund wrote: > > Hi, > > Due to bug #17245: [1] I spent a considerably amount of time looking at vacuum > related code. And I found a few things that I think could stand improvement: > > - There's pretty much no tests. This is way way too complicated