On Tue, May 16, 2017 at 8:18 AM, Haribabu Kommi <kommi.harib...@gmail.com> wrote: > In the current state of the patch, the main backend tries to start the > extra workers only when there is no tuples that are available from the > available workers. I feel that the invocation for more workers doesn't > do for every tuple.
Well, the point is, the frequency with which the leader will try to acquire more workers is going to be highly variable with your patch, and might sometimes be extremely frequent. It depends on the timing of the workers and of the leader, and I don't think that's something we want to depend on here. > Another background process logic can produce a fair distribution of > workers to the parallel queries. In this case also, the backend should > advertise only when the allotted workers are not enough, this is because > there may be a case where the planned workers may be 5, but because > of other part of the query, the main backend is feed by the tuples just by > 2 workers, then there is no need to provide extra workers. That's true, but I think taking it into account might be difficult. > The another background process approach of wait interval to reassign > more workers after an interval period doesn't work for the queries that > are getting finished before the configured time of the wait. May be we > can ignore those scenarios? I think we can ignore that. We can still help a lot of cases, and queries with very short run times obviously aren't being seriously hurt by the lack of full parallelism. -- 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