Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCRvD-0006sm-Ob for pgsql-performance@arkaria.postgresql.org; Sun, 21 May 2017 14:33:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dCRvC-0004s3-Gf for pgsql-performance@arkaria.postgresql.org; Sun, 21 May 2017 14:33:26 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dCRvA-0004rj-U0 for pgsql-performance@postgresql.org; Sun, 21 May 2017 14:33:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dCRv7-0003nL-B4 for pgsql-performance@postgresql.org; Sun, 21 May 2017 14:33:24 +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 v4LEX6W2032404; Sun, 21 May 2017 10:33:07 -0400 From: Tom Lane To: Riaan Stander cc: pgsql-performance@postgresql.org Subject: Re: Bulk persistence strategy In-reply-to: <15c29aeedc8.27e1.e05fafc80f8daf1488764675043d44fb@exa.co.za> References: <04c901d2a753$f55de020$e019a060$@exa.co.za> <15c29aeedc8.27e1.e05fafc80f8daf1488764675043d44fb@exa.co.za> Comments: In-reply-to Riaan Stander message dated "Sun, 21 May 2017 08:25:49 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32402.1495377186.1@sss.pgh.pa.us> Date: Sun, 21 May 2017 10:33:06 -0400 Message-ID: <32403.1495377186@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Riaan Stander writes: > I've come up with generating functions on the go, but I'm concerned about > the performance impact of this. I first wanted to use an anonoumys code > block, but then I cannot do parameter binding from npgsql. > ... > Is there a better way I'm missing and is "temp" function creation in > Postgres a big performance concern, especially if a server is under load? The function itself is only one pg_proc row, but if you're expecting to do this thousands of times a minute you might have to adjust autovacuum settings to avoid bad bloat in pg_proc. If you're intending that these functions be use-once, it's fairly unclear to me why you bother, as opposed to just issuing the underlying SQL statements. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance