Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f09D7-0003fC-Gu for pgsql-admin@arkaria.postgresql.org; Sun, 25 Mar 2018 17:13:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f09D6-0001fJ-Ki for pgsql-admin@arkaria.postgresql.org; Sun, 25 Mar 2018 17:13:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f09D6-0001dp-AF for pgsql-admin@lists.postgresql.org; Sun, 25 Mar 2018 17:13:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f09D3-0005WE-Dj for pgsql-admin@lists.postgresql.org; Sun, 25 Mar 2018 17:13:35 +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 w2PHDVem011208; Sun, 25 Mar 2018 13:13:31 -0400 From: Tom Lane To: "Heinemann, Manfred (IMS)" cc: "pgsql-admin@lists.postgresql.org" Subject: Re: Function search_path In-reply-to: References: <5f698c34-d01d-3196-1db4-75ba8f6a37d3@portavita.eu> <2328.1521236730@sss.pgh.pa.us> Comments: In-reply-to "Heinemann, Manfred (IMS)" message dated "Thu, 22 Mar 2018 19:30:56 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11206.1521998011.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 25 Mar 2018 13:13:31 -0400 Message-ID: <11207.1521998011@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Heinemann, Manfred (IMS)" writes: > Here is an example where I can show significant extra memory consumption= when setting search_path on a function: I got around to testing this example today, and I don't see what you're seeing --- the memory consumption seems stable, and about the same with or without the "SET search_path" clause. You didn't specify exactly how to do this bit: --populate 1,000,000 rows with random values from 1,000 surnames for 'SURN= AME' so I did it like this: INSERT INTO test_search_path(date_last_modified, last_name) select clock_timestamp(), (random()*1000)::int::text from generate_series(1,1000000); The example doesn't seem like it'd be terribly data-dependent, but maybe that's wrong? Also, I assume you're running a reasonably up-to-date PG release, otherwise I'd be wondering about leaks in the GIN index AM; we've fixed some issues of that sort in GIN bulk updates in the past. But again, it's not clear what the connection to a function SET clause would be. So I lack a plausible theory at the moment. regards, tom lane