From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Hubert Lubaczewski <depesz@depesz.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: PostgreSQL (9.3 and 9.6) eats all memory when using many tables
Date: Mon, 13 Jun 2016 14:28:05 -0400
Message-ID: <30233.1465842485@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1y4_praHwM4SPY9zsgvMThhO-Mm5Bx+mGGKyZko2ERcKw@mail.gmail.com>
References: <20160609154610.GA20600@depesz.com>
<CAMkU=1xOLwvzXDgw8=QAa-oEONmCtjoP7O-=CVqN3Cv2o41kyw@mail.gmail.com>
<20160613093907.GA10381@depesz.com>
<4400.1465824992@sss.pgh.pa.us>
<CAMkU=1y4_praHwM4SPY9zsgvMThhO-Mm5Bx+mGGKyZko2ERcKw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Jeff Janes <jeff.janes@gmail.com> writes:
> On Mon, Jun 13, 2016 at 6:36 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> While we have no direct experience with limiting the plancache size,
>> I'd expect a pretty similar issue there: a limit will either do nothing
>> except impose substantial bookkeeping overhead (if it's more than the
>> number of plans in your working set) or it will result in a performance
>> disaster from cache thrashing (if it's less).
> We don't need to keep a LRU list or do a clock sweep or anything. We
> could go really simple and just toss the whole thing into /dev/null
> when it gets too large, and start over.
Color me skeptical as heck. To the extent that you do have locality
of reference, this would piss it away.
Also, you can't just flush the plan cache altogether, not for PREPARE'd
statements and not for internally-prepared ones either, because there
are references being held for both of those. You could drop the plan
tree, certainly, but that only goes so far in terms of reducing the
amount of space needed. Dropping more than that risks subtle semantic
changes, and would break API expectations of external PLs too.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, depesz@depesz.com
Subject: Re: PostgreSQL (9.3 and 9.6) eats all memory when using many tables
In-Reply-To: <30233.1465842485@sss.pgh.pa.us>
References: <20160609154610.GA20600@depesz.com> <CAMkU=1xOLwvzXDgw8=QAa-oEONmCtjoP7O-=CVqN3Cv2o41kyw@mail.gmail.com> <20160613093907.GA10381@depesz.com> <4400.1465824992@sss.pgh.pa.us> <CAMkU=1y4_praHwM4SPY9zsgvMThhO-Mm5Bx+mGGKyZko2ERcKw@mail.gmail.com> <30233.1465842485@sss.pgh.pa.us>
* 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