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 1fKo6Z-0000jx-3h for pgsql-general@arkaria.postgresql.org; Mon, 21 May 2018 16:56:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fKo6X-0001Eu-Vh for pgsql-general@arkaria.postgresql.org; Mon, 21 May 2018 16:56:13 +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 1fKo6X-0001EV-KU for pgsql-general@lists.postgresql.org; Mon, 21 May 2018 16:56:13 +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 1fKo6V-0008Dr-4U for pgsql-general@postgresql.org; Mon, 21 May 2018 16:56:12 +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 w4LGsuX7008938; Mon, 21 May 2018 12:54:56 -0400 From: Tom Lane To: Alexey Dokuchaev cc: "David G. Johnston" , pgsql-general Subject: Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics In-reply-to: <20180521170113.GA6259@regency.nsu.ru> References: <20180521125441.GA85087@regency.nsu.ru> <30939.1526913927@sss.pgh.pa.us> <20180521162831.GA97361@regency.nsu.ru> <5595.1526919652@sss.pgh.pa.us> <20180521170113.GA6259@regency.nsu.ru> Comments: In-reply-to Alexey Dokuchaev message dated "Tue, 22 May 2018 00:01:13 +0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8936.1526921696.1@sss.pgh.pa.us> Date: Mon, 21 May 2018 12:54:56 -0400 Message-ID: <8937.1526921696@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alexey Dokuchaev writes: > Quick reality check > question: are count(*) vs. count(_) equivalent above? Only if _ is guaranteed non-null ... which, as a rowtype result, it probably is. But I'd use count(*) if you're concerned about speed. regards, tom lane