Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexey Dokuchaev <danfe(at)nsu(dot)ru>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics
Date: 2018-05-21 16:54:56
Message-ID: 8937.1526921696@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexey Dokuchaev <danfe(at)nsu(dot)ru> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexey Dokuchaev 2018-05-21 17:01:13 Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics
Previous Message Christoph Moench-Tegeder 2018-05-21 16:49:19 Re: Will Altering and Modifying tables during backup result in a corrupted server after the restore?