Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fmrx5-0007vi-ND for pgsql-general@arkaria.postgresql.org; Tue, 07 Aug 2018 02:42:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fmrx3-0006zG-Dp for pgsql-general@arkaria.postgresql.org; Tue, 07 Aug 2018 02:42:25 +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.89) (envelope-from ) id 1fmrx3-0006z8-5n for pgsql-general@lists.postgresql.org; Tue, 07 Aug 2018 02:42:25 +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.89) (envelope-from ) id 1fmrww-0001Xc-DB for pgsql-general@postgresql.org; Tue, 07 Aug 2018 02:42: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 w772gB3B027337; Mon, 6 Aug 2018 22:42:11 -0400 From: Tom Lane To: Ken Tanzer cc: Adrian Klaver , PG-General Mailing List Subject: Re: Immutable function WAY slower than Stable function? In-reply-to: References: <03120a03-75d0-ad6c-691c-35ca7e7fccfa@aklaver.com> Comments: In-reply-to Ken Tanzer message dated "Mon, 06 Aug 2018 16:44:25 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27335.1533609731.1@sss.pgh.pa.us> Date: Mon, 06 Aug 2018 22:42:11 -0400 Message-ID: <27336.1533609731@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ken Tanzer writes: > Hi Adrian. Happy to provide this info. Though on a side note, I don't > understand why it should matter, if functions are black box optimization > fences. They aren't, at least not when they are SQL-language functions that meet the conditions for inlining. The reason that EXPLAIN VERBOSE is helpful here is that you can see whether the function got inlined or not: do you see a call to the function, or a representation of its body? regards, tom lane