Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id ABBA31337B80; Wed, 13 Apr 2011 02:30:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 71911-09; Wed, 13 Apr 2011 05:29:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id F01B01337B47; Wed, 13 Apr 2011 02:29:44 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p3D5Th4L026139; Wed, 13 Apr 2011 01:29:43 -0400 (EDT) To: Merlin Moncure cc: Shianmiin , pgsql-general@postgresql.org, pgsql-bugs Subject: Re: [GENERAL] PostgreSQL backend process high memory usage issue In-reply-to: References: <1302208932097-4289407.post@n5.nabble.com> <1302215437402-4289630.post@n5.nabble.com> <1302266587288-4290723.post@n5.nabble.com> <1302276600400-4291173.post@n5.nabble.com> <1302289242961-4291699.post@n5.nabble.com> <1302300463012-4292010.post@n5.nabble.com> <1302630534510-4298807.post@n5.nabble.com> Comments: In-reply-to Merlin Moncure message dated "Tue, 12 Apr 2011 17:13:01 -0500" Date: Wed, 13 Apr 2011 01:29:43 -0400 Message-ID: <26138.1302672583@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/64 X-Sequence-Number: 29983 Merlin Moncure writes: > I think you may have uncovered a leak (I stand corrected). > The number of schemas in your test is irrelevant -- the leak is > happening in proportion to the number of views (set via \setrandom > tidx 1 10). At 1 I don't think it exists at all -- at 100 memory use > grows very fast. I don't think it's a leak, exactly: it's just that the "relcache" entry for each one of these views occupies about 100K. A backend that touches N of the views is going to need about N*100K in relcache space. I can't get terribly excited about that. Trying to reduce the size of the relcache would be a net loss for most usage patterns (ie, we'd end up increasing the amount of re-fetching from the system catalogs that backends would have to do). And I don't think that this test case has much of anything to do with sane application design, anyway. Do you really need that many complex views? Do you really need to have most sessions touching all of them? regards, tom lane