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 1lH8Fe-0005y0-Gs for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Mar 2021 16:52:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lH8Fd-0000DL-E5 for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Mar 2021 16:52:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH8Fc-0000D8-VM for pgsql-hackers@lists.postgresql.org; Tue, 02 Mar 2021 16:52:01 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH8FZ-0007pK-8F for pgsql-hackers@lists.postgresql.org; Tue, 02 Mar 2021 16:51:59 +0000 Received: from [172.16.255.146] (14.149.88.79.rev.sfr.net [79.88.149.14]) (Authenticated sender: vik@postgresfriends.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B97B9100005; Tue, 2 Mar 2021 16:51:52 +0000 (UTC) Subject: Re: GROUP BY DISTINCT To: Georgios Kokolatos , pgsql-hackers@lists.postgresql.org References: <161469758801.29967.4455067072614569957.pgcf@coridan.postgresql.org> Cc: Erik Rijkers From: Vik Fearing Message-ID: <4294e82f-a134-5dbb-d9d6-03d72dce2e1e@postgresfriends.org> Date: Tue, 2 Mar 2021 17:51:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <161469758801.29967.4455067072614569957.pgcf@coridan.postgresql.org> Content-Type: multipart/mixed; boundary="------------FA0E50240E4CFE465812C909" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------FA0E50240E4CFE465812C909 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 3/2/21 4:06 PM, Georgios Kokolatos wrote: > As a minor gripe, I would note the addition of list_int_cmp. > The block > > + /* Sort each groupset individually */ > + foreach(cell, result) > + list_sort(lfirst(cell), list_int_cmp); > > Can follow suit from the rest of the code, and define a static cmp_list_int_asc(), as > indeed the same patch does for cmp_list_len_contents_asc. > This is indeed point of which I will not hold a too strong opinion. I did it this way because list_int_cmp is a general purpose function for int lists that can be reused elsewhere in the future. Whereas cmp_list_len_contents_asc is very specific to this case so I kept it local. I'm happy to change it around if that's what consensus wants. > Overall :+1: from me. Thanks for looking at it! > I will be bumping to 'Ready for Committer' unless objections. In that case, here is another patch that fixes a typo in the docs mentioned privately to me by Erik. The typo (and a gratuitous rebase) is the only change to what you just reviewed. -- Vik Fearing --------------FA0E50240E4CFE465812C909 Content-Type: text/x-patch; charset=UTF-8; name="0001-implement-GROUP-BY-DISTINCT.v03.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-implement-GROUP-BY-DISTINCT.v03.patch"