Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEPCy-0079ex-FI for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2024 08:40:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tEPCw-006eaC-2D for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Nov 2024 08:40:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEPCv-006ea4-L7 for pgsql-hackers@lists.postgresql.org; Fri, 22 Nov 2024 08:40:05 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tEPCt-003Bnd-73 for pgsql-hackers@postgresql.org; Fri, 22 Nov 2024 08:40:04 +0000 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3e5f9712991so1030301b6e.2 for ; Fri, 22 Nov 2024 00:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732264802; x=1732869602; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4d/Sp+7X/1I7mg1Kl9C+AYbGqKuL0AXjhHUMLAUIMv4=; b=NzCLhPr/1RsgSP/L/7UdNByKbWM4LxNs9rhozxBKze2Srj7VV0pZ0AgQhbuCgBHiK1 eh1AT715XqNMiYyIARO5z5hpk2gGv7fNn+yffROKwfeL5NjSv0APFlGobHUGJKvueb5e ZxrDDC07BXJIiRcmx/RgciOAVsqpVEf9fODLU4A6kw4noSEEM/kqUgGn/oQhGvrw7dpG SQSLBas8G/N1QmzJ0fa5Q6nZ0335ii8bkyT+1958yTMOQ18e+qG5OYLOzTyaw6EOEES5 +zuUNfbhK1SioviAMufr853qXyxSNpySdu1g5yVxrlTeuXutTV/EuXYL7rxlDh14uyTp uQFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732264802; x=1732869602; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4d/Sp+7X/1I7mg1Kl9C+AYbGqKuL0AXjhHUMLAUIMv4=; b=rot4PK0nIKjO4xR01DYpW2rB/iFlVgEP8JpyB8zp8xGV2m19gzq+9lkRo7QcWHwkU/ 3tggCsV1M/KPNX4ur6gxDSZwX6y91KdnlUJ2VGCQNhmW9W9NBLVtlHq9WS9UH0chEomV 22XDT37t+8nM3+Exdye9LWlFbFsrIQsifNzTa/bmENNgMXe4lNRGyXUhgf9M24KOftBY 1pGdtDtpBYSH17oZT8awCiNJ4b0y6IVShIdXcx8fBXluKKbsP30nDiaLCISvhtPSuoNq 7EcYYeD5om0AVb3xz1F5Nyb6KLSZOOXCnGKPzqhFLAz7S/s8nYecsCoFi2ejgj3heI5X 6Mfw== X-Gm-Message-State: AOJu0YwMpcsf8iWI970RfTuwlQS5BtzWLnvPeRrLNTgunsi9VGz0cDS6 W7aNbcK4k+4wyQ0c2+SiMYlU4tuOVzAMTOS2aROo0bzU9fzZW7aS X-Gm-Gg: ASbGncu94dwrj5o25/oTxpqoGN1wy/cJgXgfK+hcYJIIIGwazH7Xt28UzzPU4nfDIui q9JAmHb9OFXeh4d/NdbcZq/FO7M+YRElPVRf05/3MJps2V52MMPW6B/p4zSn1ucD8lqRV1VlypP AbTTmoM7aSM6dOFxIhbELnyGE3aoCQxSSY5zF4YPlXngrLvUqFo70jK44gl/bmaZ4fOiykJwY2H wjbGc54cHgrSuUfXRxMkpLMgn+AP/l/xHCjptRKygF0CUKLxbhsZ4J/oRU31hshm5hjzlFji0OT X52crePHIO6oDEvVgINYdFJZ8A== X-Google-Smtp-Source: AGHT+IEZzWOGJdxREgzwCwBMxyI0D379Ev/9K1IpCedGE2xrXgHIVEsE202c5ReL1HP+R2zY8ajV+w== X-Received: by 2002:a05:6808:23cd:b0:3e7:9e01:881a with SMTP id 5614622812f47-3e9157ab281mr2031026b6e.3.1732264802498; Fri, 22 Nov 2024 00:40:02 -0800 (PST) Received: from [10.10.20.106] (node-om3.pool-125-26.dynamic.totinternet.net. [125.26.124.155]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcc3de26asm1108013a12.53.2024.11.22.00.40.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Nov 2024 00:40:01 -0800 (PST) Message-ID: Date: Fri, 22 Nov 2024 15:39:02 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Reordering DISTINCT keys to match input path's pathkeys To: Richard Guo Cc: PostgreSQL-development , David Rowley References: <0fc11a92-f6e4-4d8c-b882-91283ef54bce@gmail.com> Content-Language: en-AU From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/13/24 13:49, Richard Guo wrote: > On Mon, Oct 28, 2024 at 6:15 PM Andrei Lepikhov wrote: >> On 6/7/24 16:46, Richard Guo wrote: > I'm not sure about merging these two 'reordering' GUCs into one. > While they may look similar, they apply to very different scenarios. > However, I'm open to other suggestions. I finally have passed through the code. It generally looks OK. Let me only write a few words on tests. I wonder if it would be possible to print only three rows instead of 10 to prove the DISTINCT's correctness. Also, to stabilise tests with parallel workers, I would recommend setting max_parallel_workers_per_gather into 1 and enabling debug_parallel_query. -- regards, Andrei Lepikhov