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 1fKoFt-0001MY-OV for pgsql-general@arkaria.postgresql.org; Mon, 21 May 2018 17:05:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fKoFs-0001xH-Dl for pgsql-general@arkaria.postgresql.org; Mon, 21 May 2018 17:05:52 +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 1fKoFs-0001x6-6L for pgsql-general@lists.postgresql.org; Mon, 21 May 2018 17:05:52 +0000 Received: from mx.nsu.ru ([84.237.50.39]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fKoFo-0003iS-Vg for pgsql-general@postgresql.org; Mon, 21 May 2018 17:05:51 +0000 Received: from Debian-exim by mx.nsu.ru with local (Exim 4.72) (envelope-from ) id 1fKoFn-0000aE-54 for pgsql-general@postgresql.org; Tue, 22 May 2018 00:05:47 +0700 Received: from [84.237.50.47] (helo=regency.nsu.ru) by mx.nsu.ru with esmtp (Exim 4.72) (envelope-from ) id 1fKoFm-0000Zq-WA; Tue, 22 May 2018 00:05:47 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.14.2/8.14.2) with ESMTP id w4LHOekN013489; Mon, 21 May 2018 23:24:40 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.14.2/8.14.2/Submit) id w4LHOZk1013467; Tue, 22 May 2018 00:24:35 +0700 (+07) (envelope-from danfe) Date: Tue, 22 May 2018 00:24:35 +0700 From: Alexey Dokuchaev To: Tom Lane Cc: "David G. Johnston" , pgsql-general Subject: Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics Message-ID: <20180521172435.GA12264@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> <8937.1526921696@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8937.1526921696@sss.pgh.pa.us> User-Agent: Mutt/1.4.2.1i X-KLMS-Rule-ID: 3 X-KLMS-Message-Action: skipped X-KLMS-AntiSpam-Status: not scanned, whitelist X-KLMS-AntiPhishing: not scanned, whitelist X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.705, not scanned, whitelist List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, May 21, 2018 at 12:54:56PM -0400, Tom Lane wrote: > 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. Understood. Yes, my primary concern (after correctness) is speed. Thank you all again for very helpful and prompt replies guys. ./danfe