On Sun, Dec 1, 2019 at 11:01 PM Sergei Kornilov <s...@zsrv.org> wrote: > > Hi > > > I think I got your point. Your proposal is that it's more efficient if > > we make the leader process vacuum the index that can be processed only > > the leader process (i.e. indexes not supporting parallel index vacuum) > > while workers are processing indexes supporting parallel index vacuum, > > right? That way, we can process indexes in parallel as much as > > possible. > > Right > > > So maybe we can call vacuum_or_cleanup_skipped_indexes first > > and then call vacuum_or_cleanup_indexes_worker. But I'm not sure that > > there are parallel-safe remaining indexes after the leader finished > > vacuum_or_cleanup_indexes_worker, as described on your proposal. > > I meant that after processing missing indexes (not supporting parallel index > vacuum), the leader can start processing indexes that support the parallel > index vacuum, along with parallel workers. > Exactly call vacuum_or_cleanup_skipped_indexes after start parallel workers > but before vacuum_or_cleanup_indexes_worker or something with similar effect. > If we have 0 missed indexes - parallel vacuum will run as in current > implementation, with leader participation.
+1 -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com