On Sat, Nov 26, 2016 at 7:40 AM, Dilip Kumar <dilipbal...@gmail.com> wrote: > IMHO, barrier is used when multiple worker are doing some work > together in phase1, and before moving to next phase all have to > complete phase1, so we put barrier, so that before starting next phase > all cross the barrier. > > But here case is different, only one worker need to finish the phase1, > and as soon as it's over all can start phase2. But we don't have > requirement that all worker should cross certain barrier. In this case > even though some worker did not start, other worker can do their work.
I think the Barrier stuff has a process for choosing one worker to conduct a particular phase. So it seems like if the Barrier API is well-designed, you should be able to use it to decide who will conduct the index scan, and then when that's done everyone can proceed to scanning the heap. If that can't work for some reason, Thomas should probably adjust his API so it does. He's presenting that as a generally-useful primitive... -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers