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 1tGubu-001iVj-OT for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 06:36:14 +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 1tGubr-004jIT-Ob for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 06:36:12 +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 1tGubr-004jIH-EZ for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 06:36:12 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGubl-0007cR-RM for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 06:36:11 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2ffa97d99d6so16853051fa.1 for ; Thu, 28 Nov 2024 22:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732862164; x=1733466964; darn=lists.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=KSvK7rmP5fBVB9Qcigl4MKz6SO+r1wHIN3fguZXWnnE=; b=Kb3vXhcS/Bcqj5e1o+bhU9Bbx/WcP9s6iUQI3Lzd9QcOf68xsVpyeZYEnKVufDjR1D qHfk13DKWepSJxFTYuGqYvFVQ3NifkhVf6esrWGTHgyOuvEj9OhFnSTTFIzy5gu0wNa7 8sSgEwL1Kqfa3uOqRqw77zSqrJ8no9IJXgbqzarONSatwHtTYq/Rv9ImlGnXnkpe6AsC fQCZuvAX4uvNLQAHgNf7mISeAg9eD/BEfX0B3Cpzu/sgntDGcjgwRSus8U9I9dffkrdQ O+UoCItkDwq5P+9RMy32m1XBJ1IvaE4YHJ5RLjQRd4JXJT0wZIZMteU3mw6kwMv9Xl2+ 4BBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732862164; x=1733466964; 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=KSvK7rmP5fBVB9Qcigl4MKz6SO+r1wHIN3fguZXWnnE=; b=gFT0DGXJrYIWt2cMwHuS6vcbVwDHmfLAWi3dX7S1Zl3eJZPhXiZG22v+kLXb60dVOC PRv5M/6T/bnyOPPUnyvVaFv5+V4LZqX/rzfNv9gr/SRnMO0cGQjiJ5Kwh4Ar9ZU8D9qj sCpkj/bilHbDusgXPbGAY0Gp8y07Wqj/dX9l/BGHcHfjgCWLlJhs6h2l3XuNwkPktBPY qvjg5/iJEVUC6VKEs1wqUbVi0Nf+90ocaM2xdN2yi2qiTENLqOzanAY2E5njiFA3Z0qP kQsa6i57M0JkQWkifL4uWMggym0KcDTszfuouASWB5HHI7CNRoet/UAUKNxiWune9/Lr +rhQ== X-Forwarded-Encrypted: i=1; AJvYcCXk2yLX+iyc9DsNrN9UKZCEXg5ZonJT3fsrKzX8ni+h38shh6dy+LEGYjzCDdnUwaH0JHheDtuvA+SVapqw@lists.postgresql.org X-Gm-Message-State: AOJu0YyrvFvGVcg19+43OI+tqJ1BxqpHvzF6GShJjsfDa+fiuM+fLlA8 zSHlb8ZpQHx2LrM7D62RPzEf4fM01BTcGmVwQmLvRXsTGRu3FJcv X-Gm-Gg: ASbGncvW6DFBuSgRJ6GmHd5YmffcgFyOy2EdY51WJztJC731s1zS59FIP9v2BWF1lAv GIt0ur7N1VShP5wqezfjq++lS+QEwCHZxTkirH6tPb8qYM2ZLkhpkhdMBKNqz9P3uwdfS7IAWHV ZemQBVwxzOtWqMr4uXkwvs+n4YRPpT484vSxNz2N6eRwkRlPVP0NEO0ved8K0Qf82j8GqjieW8v ktn3uR0yRK+c+QSoWRjG1//SB3azHlQbZ1HTVVCyxj8rgYr7YGsMcSmSELY4emDRuANGf4Vo2Mw cw2J0yHhYvAuT0Q4SckA66dT X-Google-Smtp-Source: AGHT+IHFkXC1JfFgORwUV97vzWdqKRLgqXFb9nqhU6K8FtD7sasPHAPJVtPSqOhzk1TH9GJiK119jg== X-Received: by 2002:a2e:bcd1:0:b0:2fb:51a2:4f63 with SMTP id 38308e7fff4ca-2ffd6142a6emr66267141fa.34.1732862163705; Thu, 28 Nov 2024 22:36:03 -0800 (PST) Received: from [10.10.20.106] (node-hoh.pool-125-27.dynamic.totinternet.net. [125.27.89.129]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ffdfbb8e7fsm3898001fa.2.2024.11.28.22.36.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Nov 2024 22:36:02 -0800 (PST) Message-ID: <1507cbb9-937f-48f5-9931-b67014511f9b@gmail.com> Date: Fri, 29 Nov 2024 13:35:56 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Remove useless GROUP BY columns considering unique index To: David Rowley Cc: Zhang Mingli , PostgreSQL Hackers , jian he References: <327990c8-b9b2-4b0c-bffb-462249f82de0@Spark> Content-Language: en-AU From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/29/24 09:39, David Rowley wrote: > On Fri, 29 Nov 2024 at 15:02, David Rowley wrote: >> I've attached an updated patch that gets rid of the >> get_unique_not_null_attnos() function completely and uses the >> RelOptInfo.indexlist and RelOptInfo.notnullattnums. > > I forgot to do a local commit before sending v8. Fixed in the attached v9. 1. Thread reference in the patch comment doesn't work. 2. May it be possible to move remove_useless_groupby_columns in the second commit? It would be easier to review the differences. -- regards, Andrei Lepikhov