Re: [HACKERS] Block level parallel vacuum

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Mahendra Singh <mahi6run(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Amit Langote <langote_amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, David Steele <david(at)pgmasters(dot)net>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Block level parallel vacuum
Date: 2019-12-01 10:06:42
Message-ID: 1962511575194802@sas8-7ec005b03c91.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

> I think the advantage of the current approach is that once the parallel workers are launched, the leader can process indexes that don't support parallelism.  So, both type of indexes can be processed at the same time.

In lazy_parallel_vacuum_or_cleanup_indexes I see:

/*
* Join as a parallel worker. The leader process alone does that in
* case where no workers launched.
*/
if (lps->leaderparticipates || lps->pcxt->nworkers_launched == 0)
vacuum_or_cleanup_indexes_worker(Irel, nindexes, stats, lps->lvshared,
vacrelstats->dead_tuples);

/*
* Here, the indexes that had been skipped during parallel index vacuuming
* are remaining. If there are such indexes the leader process does vacuum
* or cleanup them one by one.
*/
vacuum_or_cleanup_skipped_indexes(vacrelstats, Irel, nindexes, stats,
lps);

So parallel leader will process parallel indexes first along with parallel workers and skip non-parallel ones. Only after end of the index list parallel leader will process non-parallel indexes one by one. In case of equal index processing time parallel leader will process (count of parallel indexes)/(nworkers+1) + all non-parallel, while parallel workers will process (count of parallel indexes)/(nworkers+1). I am wrong here?

regards, Sergei

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Grigory Smolkin 2019-12-01 14:58:54 Re: pg_upgrade fails with non-standard ACL
Previous Message 盏一 2019-12-01 07:31:55 Issue about memory order on ARM