Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7juv-0008Eo-FM for pgsql-general@arkaria.postgresql.org; Thu, 26 Oct 2017 15:17:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e7juv-0000YG-26 for pgsql-general@arkaria.postgresql.org; Thu, 26 Oct 2017 15:17:57 +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 1e7jut-0000Wf-Kg for pgsql-general@postgresql.org; Thu, 26 Oct 2017 15:17:55 +0000 Received: from mail-pg0-x233.google.com ([2607:f8b0:400e:c05::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1e7juq-0002hJ-G7 for pgsql-general@postgresql.org; Thu, 26 Oct 2017 15:17:55 +0000 Received: by mail-pg0-x233.google.com with SMTP id g6so2940571pgn.6 for ; Thu, 26 Oct 2017 08:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=V7Bi4q3cby1K8jA6lr6pBSIj9uac0qDvmRBZIvtVxrw=; b=L4minvUUJGClOryC5/jPtQtBKzA5i296EZsxfJIF/XH5BhiB1a9tKrxpToxAnJBsrC SwXQEmtLKbJLqDimjEjb3/KGHVI3MqZ0gBmzibjHE1PJc7/3M2zQos0+4FoNLKPGRUPf ehbyd/qRlvaLDu0sA4w5651BqleNzI2FN8HnZTyHXJ4RkADoBEstTYEKuu6/njNBpNn1 DmL8MlvsELG+X3ryfRVa5Uy93YRAEYEAVxK2t3KzrBdFSONtRbfuSHJMdNigab4nFxfs uV7bnmCASBZA/5hbtRVNpJC470PcXdMkkUqqoZYLkPJVfpvzOHGPf7nGryZ5MiHVkS9c pNww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=V7Bi4q3cby1K8jA6lr6pBSIj9uac0qDvmRBZIvtVxrw=; b=oYFIQT2YLPSNQ+d1OYtLraP2Jz+gIx00TCtqzALfs09w2BiN5lgXak8PJ8fTUiXAxD Id0FOwI1MzMV19KtbBRLGqhWVkbSOPSXfBZeQs/qMvaagyk8FyLG3rE2nc+ynZYtQPu7 ty7etPVOCU971eexKKMvJROi2TeFJwDfDzZWTUM3IeGNG/qjG4iDmUxZbf4VUCG3hzvM 8ePZclCUCzcfrDNP6PZaJojdYoM1Ib8tFWAvYM8XgESN4Wxj93zDePkir6/5s2loRQSI jXzGXP9vhKbO7xaTKKlHt1KWkv+Gzgp9Nwd2ypw402Rtyxom9wUajeSJg1tJxy5HsEwe tHgg== X-Gm-Message-State: AMCzsaU/0G1QAkFDolJRFVPSyISzMtu3FqJLMVM3+EsTZGqc3ukPVHl7 D244uvxQqek7B/odF54ZSZShQp/W X-Google-Smtp-Source: ABhQp+RHx+de5//GzIL4yhJW6rN3Nx6aRD5FUCfwZDg6pH/lTeuyvmADQIPL+do0S8gFitagmfYOeA== X-Received: by 10.98.33.203 with SMTP id o72mr5683186pfj.41.1509031070223; Thu, 26 Oct 2017 08:17:50 -0700 (PDT) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id x4sm9838501pge.23.2017.10.26.08.17.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Oct 2017 08:17:48 -0700 (PDT) Subject: Re: query not scaling To: Tom Lane , Laurenz Albe References: <6f7d4fd4-aed2-2fae-f551-d0f67196da33@gmail.com> <1509001363.2666.1.camel@cybertec.at> <30441.1509030087@sss.pgh.pa.us> Cc: "pgsql-general@postgresql.org" From: Rob Sargent Message-ID: <857d59d2-bf2a-a595-7fcc-9b35fa3fb86a@gmail.com> Date: Thu, 26 Oct 2017 09:17:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <30441.1509030087@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="------------8DBF650192764B6774FB620B" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------8DBF650192764B6774FB620B Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 10/26/2017 09:01 AM, Tom Lane wrote: > Laurenz Albe writes: >> Also, to have PostgreSQL inline the function, which would be good >> for performance, it should be declared IMMUTABLE. > Actually, if you hope to have a SQL function be inlined, it's better > not to decorate it at all --- not with IMMUTABLE, and not with STRICT > either. Both of those restrict the parser's ability to inline unless > it can prove the contained expression is equally immutable/strict. > With the default attributes of volatile/not strict, there's nothing > to prove. > > (In any case, it's usually easy enough to tell from EXPLAIN output > whether inlining has happened.) > > regards, tom lane As to the explain analyze, could not receive data from server: Connection timed out Time: 7877340.565 ms for the second time. I had presumed at first that this had occurred during a network burp. I'll try running it directly on the pg host. --------------8DBF650192764B6774FB620B Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit



On 10/26/2017 09:01 AM, Tom Lane wrote:
Laurenz Albe <laurenz.albe@cybertec.at> writes:
Also, to have PostgreSQL inline the function, which would be good
for performance, it should be declared IMMUTABLE.
Actually, if you hope to have a SQL function be inlined, it's better
not to decorate it at all --- not with IMMUTABLE, and not with STRICT
either.  Both of those restrict the parser's ability to inline unless
it can prove the contained expression is equally immutable/strict.
With the default attributes of volatile/not strict, there's nothing
to prove.

(In any case, it's usually easy enough to tell from EXPLAIN output
whether inlining has happened.)

			regards, tom lane
As to the explain analyze,
could not receive data from server: Connection timed out
Time: 7877340.565 ms
for the second time.  I had presumed at first that this had occurred during a network burp.  I'll try running it directly on the pg host.

--------------8DBF650192764B6774FB620B--