Re: [HACKERS] Block level parallel vacuum - Mailing list pgsql-hackers
From | Masahiko Sawada |
---|---|
Subject | Re: [HACKERS] Block level parallel vacuum |
Date | |
Msg-id | CAD21AoC96XPEMW0eEcBX9Gkw1FPPWbHii68hoqDaCwB8-rpfZw@mail.gmail.com Whole thread Raw |
In response to | Re: [HACKERS] Block level parallel vacuum (Haribabu Kommi <kommi.haribabu@gmail.com>) |
Responses |
Re: [HACKERS] Block level parallel vacuum
|
List | pgsql-hackers |
On Fri, Jan 18, 2019 at 10:38 AM Haribabu Kommi <kommi.haribabu@gmail.com> wrote: > > > On Tue, Jan 15, 2019 at 6:00 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote: >> >> >> Rebased. > > > I started reviewing the patch, I didn't finish my review yet. > Following are some of the comments. Thank you for reviewing the patch. > > + <term><literal>PARALLEL <replaceable class="parameter">N</replaceable></literal></term> > + <listitem> > + <para> > + Execute index vacuum and cleanup index in parallel with > > I doubt that user can understand the terms index vacuum and cleanup index. > May be it needs some more detailed information. > Agreed. Table 27.22 "Vacuum phases" has a good description of vacuum phases. So maybe adding the referencint to it would work. > > - VACOPT_DISABLE_PAGE_SKIPPING = 1 << 7 /* don't skip any pages */ > + VACOPT_PARALLEL = 1 << 7, /* do lazy VACUUM in parallel */ > + VACOPT_DISABLE_PAGE_SKIPPING = 1 << 8 /* don't skip any pages */ > +} VacuumOptionFlag; > > Any specific reason behind not adding it as last member of the enum? > My mistake, fixed it. > > -typedef enum VacuumOption > +typedef enum VacuumOptionFlag > { > > I don't find the new name quite good, how about VacuumFlags? > Agreed with removing "Option" from the name but I think VacuumFlag would be better because this enum represents only one flag. Thoughts? > > +typedef struct VacuumOption > +{ > > How about VacuumOptions? Because this structure can contains all the > options provided to vacuum operation. > Agreed. > > > + vacopt1->flags |= vacopt2->flags; > + if (vacopt2->flags == VACOPT_PARALLEL) > + vacopt1->nworkers = vacopt2->nworkers; > + pfree(vacopt2); > + $$ = vacopt1; > + } > > As the above statement indicates the the last parallel number of workers > is considered into the account, can we explain it in docs? > Agreed. > > postgres=# vacuum (parallel 2, verbose) tbl; > > With verbose, no parallel workers related information is available. > I feel giving that information is required even when it is not parallel > vacuum also. > Agreed. How about the folloiwng verbose output? I've added the number of launched, planned and requested vacuum workers and purpose (vacuum or cleanup). postgres(1:91536)=# vacuum (verbose, parallel 30) test; -- table 'test' has 3 indexes INFO: vacuuming "public.test" INFO: launched 2 parallel vacuum workers for index vacuum (planned: 2, requested: 30) INFO: scanned index "test_idx1" to remove 2000 row versions DETAIL: CPU: user: 0.12 s, system: 0.00 s, elapsed: 0.12 s INFO: scanned index "test_idx2" to remove 2000 row versions by parallel vacuum worker DETAIL: CPU: user: 0.07 s, system: 0.05 s, elapsed: 0.12 s INFO: scanned index "test_idx3" to remove 2000 row versions by parallel vacuum worker DETAIL: CPU: user: 0.09 s, system: 0.05 s, elapsed: 0.14 s INFO: "test": removed 2000 row versions in 10 pages DETAIL: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s INFO: launched 2 parallel vacuum workers for index cleanup (planned: 2, requested: 30) INFO: index "test_idx1" now contains 991151 row versions in 2745 pages DETAIL: 2000 index row versions were removed. 24 index pages have been deleted, 18 are currently reusable. CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s. INFO: index "test_idx2" now contains 991151 row versions in 2745 pages DETAIL: 2000 index row versions were removed. 24 index pages have been deleted, 18 are currently reusable. CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s. INFO: index "test_idx3" now contains 991151 row versions in 2745 pages DETAIL: 2000 index row versions were removed. 24 index pages have been deleted, 18 are currently reusable. CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s. INFO: "test": found 2000 removable, 367 nonremovable row versions in 41 out of 4425 pages DETAIL: 0 dead row versions cannot be removed yet, oldest xmin: 500 There were 6849 unused item pointers. Skipped 0 pages due to buffer pins, 0 frozen pages. 0 pages are entirely empty. CPU: user: 0.12 s, system: 0.01 s, elapsed: 0.17 s. VACUUM Since the previous patch conflicts with 285d8e12 I've attached the latest version patch that incorporated the review comment I got. Regards, -- Masahiko Sawada NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
Attachment
pgsql-hackers by date: