Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ah2Zw-0003eR-6z for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Mar 2016 22:09:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ah2Zu-0006YQ-C5 for pgsql-bugs@arkaria.postgresql.org; Fri, 18 Mar 2016 22:09:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ah2ZH-0005gS-DR for pgsql-bugs@postgresql.org; Fri, 18 Mar 2016 22:08:27 +0000 Received: from c.mail.sonic.net ([64.142.111.80]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ah2ZE-000496-4L for pgsql-bugs@postgresql.org; Fri, 18 Mar 2016 22:08:25 +0000 Received: from engels (162-236-13-58.lightspeed.sntcca.sbcglobal.net [162.236.13.58]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u2IM8GAR017110 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA256 bits=128 verify=NOT); Fri, 18 Mar 2016 15:08:16 -0700 Date: Fri, 18 Mar 2016 15:08:18 -0700 From: David Gould To: Tom Lane Cc: Jim Nasby , Alvaro Herrera , Jeff Janes , Pg Bugs , Josh Berkus Subject: Re: BUG #13750: Autovacuum slows down with large numbers of tables. More workers makes it slower. Message-ID: <20160318150818.32982178@engels> In-Reply-To: <16126.1458308374@sss.pgh.pa.us> References: <20160302034537.0b1c2da7@engels> <20160315204026.GA29216@alvherre.pgsql> <20160315142816.5dca09dd@engels> <56EBAB26.4090905@BlueTreble.com> <16126.1458308374@sss.pgh.pa.us> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVbW4NaexAZwTOOvCQGBL38MrHB1NNQ5PjHlilNImu5+v70iSTGCN4gf8rTJSp3323IFbdM6vLth1peJR56YcRyg X-Sonic-ID: C;wtVS6lXt5RGRH5/fr5/Qwg== M;dByM6lXt5RGRH5/fr5/Qwg== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, 18 Mar 2016 09:39:34 -0400 Tom Lane wrote: > Jim Nasby writes: > > I actually wonder if instead of doing all the the hard way in C whether > > we should just use SPI for each worker to build it's list of tables. The > > big advantage that would provide is the ability for users to customize > > the scheduling, but I suspect it'd make the code simpler too. > > By that you mean "user can write a SQL query that determines autovacuum > targets"? -1. That would bring us back to the bad old days where a > poorly-thought-out vacuum cron job would miss tables and lead to a > database shutdown. Not to mention SQL injection risks. > > If we need to improve autovac's strategy, let's do that, but not by > deeming it the user's problem. I have some thoughts for a different approach. In short, the stats collector actually knows what needs vacuuming because queries that create dead tuples tell it. I'm considering have the stats collector maintain a queue of vacuum work and that autovacuum request work from the stats collector. When I have something more concrete I'll post it on hackers. -dg -- David Gould 510 282 0869 daveg@sonic.net If simplicity worked, the world would be overrun with insects. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs