pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jorge Daniel <elgaita@hotmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Cc: dyuryeva@medallia.com <dyuryeva@medallia.com>
Subject: Re: OOM Killing on Docker while ANALYZE running
Date: Thu, 25 Jan 2018 20:58:44 +0000
Message-ID: <CP2P152MB03565E588C988C2A91E98191BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20180125194720.ammwkya3dvj23rjc@alvherre.pgsql>
References: <CP2P152MB03563AA07394B591FD640158BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM>
	<20180125194720.ammwkya3dvj23rjc@alvherre.pgsql>

HI Alvaro:


These are our values


default_statistics_target
---------------------------
 10000



 relpages | reltuples
----------+-----------
  1639345 |     1e+08


                      Table "public.pgbench_accounts"
  Column  |     Type      | Modifiers | Storage  | Stats target | Description
----------+---------------+-----------+----------+--------------+-------------
 aid      | integer       | not null  | plain    |              |
 bid      | integer       |           | plain    |              |
 abalance | integer       |           | plain    |              |
 filler   | character(84) |           | extended |              |
Indexes:
    "pgbench_accounts_pkey" PRIMARY KEY, btree (aid)
Options: fillfactor=100




I guess you hit the knotch:


pgbench=# set default_statistics_target =10;
SET
pgbench=# analyze verbose pgbench_accounts ;
INFO:  analyzing "public.pgbench_accounts"
INFO:  "pgbench_accounts": scanned 3000 of 1639345 pages, containing 183000 live rows and 0 dead rows; 3000 rows in sample, 100000000 estimated total rows
ANALYZE
pgbench=# set default_statistics_target =100;
SET
pgbench=# analyze verbose pgbench_accounts ;
INFO:  analyzing "public.pgbench_accounts"
INFO:  "pgbench_accounts": scanned 30000 of 1639345 pages, containing 1830000 live rows and 0 dead rows; 30000 rows in sample, 100000001 estimated total rows
ANALYZE
pgbench=# set default_statistics_target =1000;
SET
pgbench=# analyze verbose pgbench_accounts ;
INFO:  analyzing "public.pgbench_accounts"
INFO:  "pgbench_accounts": scanned 300000 of 1639345 pages, containing 18300000 live rows and 0 dead rows; 300000 rows in sample, 100000008 estimated total rows
ANALYZE
pgbench=# set default_statistics_target =10000;
SET
pgbench=# 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 estimated total rows
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.


Kind regards


Jorge Daniel Fernandez


________________________________
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Sent: Thursday, January 25, 2018 4:47 PM
To: Jorge Daniel
Cc: pgsql-admin@lists.postgresql.org; pgsql-admin@postgresql.org; dyuryeva@medallia.com
Subject: Re: OOM Killing on Docker while ANALYZE running

Jorge Daniel wrote:
> Hi guys , I'm dealing with OOM killing on Postgresql 9.4.8 running on docker ,

What is your statistics target?  analyze is supposed to acquire samples
of the data, not the whole table ...

> pgbench=# 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 estimated total rows

Here it seems to be saying that it reads all 1.6 million pages ...

--
Álvaro Herrera                https://www.2ndQuadrant.com/
Professional PostgreSQL | 2ndQuadrant<https://www.2ndquadrant.com/;
www.2ndquadrant.com
Stay in touch with us. Subscribe to our monthly newsletter to hear the latest developments from 2ndQuadrant and related technologies. We’ll also send you any ...



PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

view thread (6+ messages)  latest in thread

Message-ID: <CP2P152MB03565E588C988C2A91E98191BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM>
Permalink:  ../CP2P152MB03565E588C988C2A91E98191BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/CP2P152MB03565E588C988C2A91E98191BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: elgaita@hotmail.com, alvherre@alvh.no-ip.org, dyuryeva@medallia.com
  Subject: Re: OOM Killing on Docker while ANALYZE running
  In-Reply-To: <CP2P152MB03565E588C988C2A91E98191BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM>
  References: <CP2P152MB03563AA07394B591FD640158BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM> <20180125194720.ammwkya3dvj23rjc@alvherre.pgsql> <CP2P152MB03565E588C988C2A91E98191BCE10@CP2P152MB0356.LAMP152.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox