From: Justin Pryzby <pryzby@telsasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Craig Ringer <craig@2ndquadrant.com>
Cc: Greg Stark <stark@mit.edu>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [GENERAL] huge RAM use in multi-command ALTER of table heirarchy
Date: Sat, 28 Apr 2018 11:00:32 -0500
Message-ID: <20180428160032.GN20071@telsasoft.com> (raw)
In-Reply-To: <20171018195454.GI17895@telsasoft.com>
References: <CAM-w4HML0Vd1Us845UK4K38F_sncDbMk_Jpk4-k1nwtmM59zqQ@mail.gmail.com>
<946544e1-a4d7-12b5-60c6-c2b5f956ec6a@lab.ntt.co.jp>
<6051.1500556750@sss.pgh.pa.us>
<CAM-w4HP9dtsM8GyoAgZhGLyXWAs30siUpoUg2n6+b6GcO4E0=w@mail.gmail.com>
<CAMsr+YFJa24FGiU1_6Z8wygd-jmvQ7OF1bJk0i8U18wSz2+QXQ@mail.gmail.com>
<31269.1500420390@sss.pgh.pa.us>
<20171018195454.GI17895@telsasoft.com>
On Tue, Jul 18, 2017 at 07:26:30PM -0400, Tom Lane wrote:
> > It's probably a bit late in the v10 cycle to be taking any risks in
> > this area, but I'd vote for ripping out RememberToFreeTupleDescAtEOX
> > as soon as the v11 cycle opens, unless someone can show an example
> > of non-broken coding that requires it. (And if so, there ought to
> > be a regression test incorporating that.)
I'm resending this in case it's been forgotten about and in case there's still
time this cycle to follow through in removing RememberToFreeTupleDescAtEOX.
..And because I ran into it again earlier this month, ALTERing an 1600 column
table with 500 children (actually while rewriting to reduce to 12 childs); on a
dedicated DB VM with 8GB RAM:
Mar 7 11:44:52 telsaDB kernel: Out of memory: Kill process 47490 (postmaster) score 644 or sacrifice child
Mar 7 11:44:52 telsaDB kernel: Killed process 47490, UID 26, (postmaster) total-vm:6813528kB, anon-rss:5212288kB, file-rss:2296kB
On Wed, Oct 18, 2017 at 02:54:54PM -0500, Justin Pryzby wrote:
> Hi,
>
> I just ran into this again in another context (see original dicussion, quoted
> below).
>
> Some time ago, while initially introducting non-default stats target, I set our
> non-filtering columns to "STATISTICS 10", lower than default, to minimize the
> size of pg_statistic, which (at least at one point) I perceived to have become
> bloated and causing issue (partially due to having an excessive number of
> "daily" granularity partitions, a problem I've since mitigated).
>
> The large number of columns with non-default stats target was (I think) causing
> pg_dump --section=pre-data to take 10+ minutes, which makes pg_upgrade more
> disruptive than necessary, so now I'm going back and fixing it.
>
> [pryzbyj@database ~]$ time sed '/SET STATISTICS 10;$/!d; s//SET STATISTICS -1;/' /srv/cdrperfbackup/ts/2017-10-17/pg_dump-section\=pre-data |psql -1q ts
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> connection to server was lost
>
> [pryzbyj@database ~]$ dmesg |tail -n2
> Out of memory: Kill process 6725 (postmaster) score 550 or sacrifice child
> Killed process 6725, UID 26, (postmaster) total-vm:13544792kB, anon-rss:8977764kB, file-rss:8kB
>
> So I'm hoping to encourage someone to commit the change contemplated earlier.
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-general@postgresql.org
Cc: pryzby@telsasoft.com, tgl@sss.pgh.pa.us, simon@2ndquadrant.com, craig@2ndquadrant.com, stark@mit.edu, Langote_Amit_f8@lab.ntt.co.jp, pgsql-hackers@postgreSQL.org
Subject: Re: [GENERAL] huge RAM use in multi-command ALTER of table heirarchy
In-Reply-To: <20180428160032.GN20071@telsasoft.com>
References: <CAM-w4HML0Vd1Us845UK4K38F_sncDbMk_Jpk4-k1nwtmM59zqQ@mail.gmail.com> <946544e1-a4d7-12b5-60c6-c2b5f956ec6a@lab.ntt.co.jp> <6051.1500556750@sss.pgh.pa.us> <CAM-w4HP9dtsM8GyoAgZhGLyXWAs30siUpoUg2n6+b6GcO4E0=w@mail.gmail.com> <CAMsr+YFJa24FGiU1_6Z8wygd-jmvQ7OF1bJk0i8U18wSz2+QXQ@mail.gmail.com> <31269.1500420390@sss.pgh.pa.us> <20171018195454.GI17895@telsasoft.com> <20180428160032.GN20071@telsasoft.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