Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqPg2-00071L-6w for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jul 2019 22:24:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hqPg0-00061b-4I for pgsql-bugs@arkaria.postgresql.org; Wed, 24 Jul 2019 22:24:00 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqPfz-00060T-Sm for pgsql-bugs@lists.postgresql.org; Wed, 24 Jul 2019 22:23:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hqPfx-0007mf-Hn for pgsql-bugs@lists.postgresql.org; Wed, 24 Jul 2019 22:23:59 +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 x6OMNjbj003423; Wed, 24 Jul 2019 18:23:45 -0400 From: Tom Lane To: dmigowski@ikoffice.de cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15923: Prepared statements take way too much memory. In-reply-to: <15923-4b35496c683c52d2@postgresql.org> References: <15923-4b35496c683c52d2@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Wed, 24 Jul 2019 21:39:35 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3421.1564007025.1@sss.pgh.pa.us> Date: Wed, 24 Jul 2019 18:23:45 -0400 Message-ID: <3422.1564007025@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > Prepared Statements take too much memory. I'm not really sure what you expect us to do about this. If you PREPARE a bunch of statements and never DEALLOCATE them, then yes they're going to consume memory; maybe a lot of memory if the plans are complex. The only thing we could do to reduce the memory consumption is to throw away the plans, which kind of defeats the purpose of a prepared statement, wouldn't you say? And even holding onto enough information to re-create the plan later would consume some amount of memory, so you will still have a problem if you keep making prepared statements and never release them. regards, tom lane