Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeoRm-0005dJ-PI for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jan 2018 20:48:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeoRm-0003DI-6y for pgsql-admin@arkaria.postgresql.org; Thu, 25 Jan 2018 20:48:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eeoRl-0003D9-WC for pgsql-admin@lists.postgresql.org; Thu, 25 Jan 2018 20:48:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eeoRj-0000kQ-84 for pgsql-admin@lists.postgresql.org; Thu, 25 Jan 2018 20:48:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w0PKmQHR029103; Thu, 25 Jan 2018 15:48:26 -0500 From: Tom Lane To: Alvaro Herrera cc: Jorge Daniel , "pgsql-admin@lists.postgresql.org" , "pgsql-admin@postgresql.org" , "dyuryeva@medallia.com" Subject: Re: OOM Killing on Docker while ANALYZE running In-reply-to: <20180125194720.ammwkya3dvj23rjc@alvherre.pgsql> References: <20180125194720.ammwkya3dvj23rjc@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 25 Jan 2018 16:47:20 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29101.1516913306.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 25 Jan 2018 15:48:26 -0500 Message-ID: <29102.1516913306@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > Jorge Daniel wrote: >> Hi guys , I'm dealing with OOM killing on Postgresql 9.4.8 running on d= ocker , > What is your statistics target? analyze is supposed to acquire samples > of the data, not the whole table ... >> pgbench=3D# analyze verbose pgbench_accounts; >> INFO: analyzing "public.pgbench_accounts" >> INFO: "pgbench_accounts": scanned 1639345 of 1639345 pages, containing= 100000000 live rows and 0 dead rows; 3000000 rows in sample, 100000000 es= timated total rows The standard setting of default_statistics_target would only result in trying to acquire a 30000-row sample, so the problem here is having cranked that up beyond what the machine can sustain. AFAIR we do not consider maintenance_work_mem as imposing a limit on the sample size. regards, tom lane