Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMx1z-0005jv-HW for pgsql-docs@arkaria.postgresql.org; Thu, 18 Mar 2021 18:05:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMx1y-0006BL-Fi for pgsql-docs@arkaria.postgresql.org; Thu, 18 Mar 2021 18:05:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMx1y-0006Aw-9z for pgsql-docs@lists.postgresql.org; Thu, 18 Mar 2021 18:05:58 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lMx1v-0002az-SC for pgsql-docs@lists.postgresql.org; Thu, 18 Mar 2021 18:05:57 +0000 Received: by mail-ej1-x62a.google.com with SMTP id w3so5385061ejc.4 for ; Thu, 18 Mar 2021 11:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ZoNEwq/6mtirnIN6RMQ9CFJIpuYO/LmA5yI9FQSd0uM=; b=iGefDSYUIx/OnuzLszQtvtW/VCckk0XOCt43lZAZd94ljl6Hpb7x7C3JQERY37d+WL z1byPtWGXidu2AHaP70BAtpV6/8ZDbzY5WpghLI/hrjEywN2B4j8vnogxOHPrGmgPl/R 064uNoJ2xCdlmZC2D+XcjrAMKHPS5Ci/AG4v2+0PUhizvSPHMSDC53mko0i8ozoS3YMK mnBwplME9O+wyuE8ilRnmq4hjeaPSTtH58AiVLQ+V7JTeHls+x4G3y7kmRd/CFbWU7vI XmX28lp4u9t45JGk3I1ucz17+AS/C5RXE1j+QdoAg5t+IoF3yrvbZ2UD5iThlWVw2A3v gLig== 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZoNEwq/6mtirnIN6RMQ9CFJIpuYO/LmA5yI9FQSd0uM=; b=MSbgePd7r9uinyHhhv4YQZfP/UUNEFqZz/k0MRyNI8XcQtH5S75R/aFD5+MrUQizeE 2xnXpc59wtghdU55vrlIQgo8StcMZjFNsQcN1G/KBLBWASNAzisqn76Hwbfmc/uqKRD8 nfldGzjYbgL8Wd9SXdEOuvRKXE9HFh+XBm6ykaZPgPEFGyuNexAjkMj+q+1YEalaj584 g4XcPTxqDp92cjmixcaD64UO69OZad5lZ8E5+8v5yGAv9PhYiZgOiGVmC2aFh/LVluG6 NrYLHzghtI0LHbRsQZMuS7rDJ8Al/tnHOVcXieTt+DfU1z8ZaKFwUtAiCLm/oGKBrUiy T45g== X-Gm-Message-State: AOAM530eShHKJPFs5e/IDOBvgmt1OlniJs0jyUjI4njgkHE4VJO+ZmTK YTU5cZIk7oy2h6FAkutRhx8q38Sk8rd77M6dPDOZKbdJTDkkRG1t51VSeKp3K3/X+Yc2KQBLLC0 0I9G9xbn4mLIntiNNQJLpFzk7O8aFP3oCHQT/1wwu8uryMgjD8eemwhsvNwnBt6WRB2FgYvybM8 8R6Rx5BXTTIikSLwpcDLYYLPzPoJqSR+UbQFBAaewnrAWxNOXl8rVSnxV7Ru7j9mdWIn0V7b0O7 HT+8DoOSYYjiJBKBLKTpF6L7UoUQFYxyn3BvPtittgB8w== X-Google-Smtp-Source: ABdhPJyPP0upcqXRWgRL33OJLAeRtO7W/KF9gZVGAP6F7yj/pPtfW19GHGSvyM9lh8EqKgebIedX8w== X-Received: by 2002:a17:906:819:: with SMTP id e25mr43187805ejd.292.1616090754571; Thu, 18 Mar 2021 11:05:54 -0700 (PDT) Received: from [10.137.0.20] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id ld19sm2320535ejb.102.2021.03.18.11.05.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 11:05:54 -0700 (PDT) Subject: Re: DISTINCT term in aggregate function To: Pantelis Theodosiou , pgsql-docs@lists.postgresql.org References: <161469758801.29967.4455067072614569957.pgcf@coridan.postgresql.org> <4294e82f-a134-5dbb-d9d6-03d72dce2e1e@postgresfriends.org> From: Tomas Vondra Message-ID: <48e7af6c-a997-e361-3dec-1382a5824831@enterprisedb.com> Date: Thu, 18 Mar 2021 19:05:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Sorry, I'm not reading pgsql-docs very often, so I missed the post. Yeah, we should probably add an indexterm to the other places too. regards On 3/18/21 7:03 PM, Pantelis Theodosiou wrote: > Hi, I didn't think of including you in this suggestion. > Or the pdsql-docs was not the right list to post? I didn't want to mix > it with the GROUP BY DISTINCT patch. > > Please check my suggestion. > > Best regards > Pantelis Theodosiou > > > > > ---------- Forwarded message --------- > From: *Pantelis Theodosiou* > > Date: Sat, Mar 13, 2021 at 1:03 AM > Subject: Fwd: GROUP BY DISTINCT > To: > > > > > ---------- Forwarded message --------- > From: *Tomas Vondra* > > Date: Fri, Mar 12, 2021 at 11:33 PM > Subject: Re: GROUP BY DISTINCT > To: Vik Fearing >, Georgios Kokolatos > >, > > > Cc: Erik Rijkers > > > > Hi Vik, > > The patch seems quite ready, I have just two comments. > > 1) Shouldn't this add another for DISTINCT, somewhere in the > documentation? Now the index points just to the SELECT DISTINCT part. > > ..... > > regards > > -- > Tomas Vondra > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > > > After reading the above thread in hackers, I noticed that the index does > not point to aggrgeate functions either and DISTINCT is not mentioned in > the aggregate functions page > either: https://www.postgresql.org/docs/current/functions-aggregate.html > > Shouldn't it be mentioned with an example of COUNT(DISTINCT ...)  or > aggregate_function(DISTINCT ...) in general ? > > Best regards > > Pantelis Theodosiou -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company