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 1oUxtK-0004sH-Q7 for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Sep 2022 22:14: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 1oUxtJ-0006Mp-Hz for pgsql-hackers@arkaria.postgresql.org; Sun, 04 Sep 2022 22:14:57 +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 1oUxtI-0006Mg-NJ for pgsql-hackers@lists.postgresql.org; Sun, 04 Sep 2022 22:14:57 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oUxtF-0005jD-CL for pgsql-hackers@lists.postgresql.org; Sun, 04 Sep 2022 22:14:55 +0000 Received: by mail-wm1-x32c.google.com with SMTP id z14-20020a7bc7ce000000b003a5db0388a8so6194973wmk.1 for ; Sun, 04 Sep 2022 15:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=Q8JPnOZI7cq6mO+92ZxrjScg4aqVHCyHOv5PdcKsPPg=; b=VeIAnpib79zfOsobaA6BfKciUfj7TzG2MRgmO3hEZAMLZO/inQMG01Jau7DgcZNkU5 McemoADvgEcQwGN62gLLKexXWi+U3aUlNHdWT87Zp0KCM+m8Bx15Q2oVE/xYQdSjJWqI sWBCdFd1F1C0FwLAEe2Ja0oT5hPpmpO5EnANYOE+aupALR17hZxeAwOYxDJJKM2bn/3M 4iQNUBrpcy7nK5OPtaouRcNOUOBI7Zw279IEKyLQRffOaC10yrJYYIJ3zCfay6gQKdbo e380V2Jk1UxF1Vuq0FdbAweWAmZIw+k5k4mcIhjVvGCtrrfQWfxxgJV9mksMrlxcSNPR zt7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Q8JPnOZI7cq6mO+92ZxrjScg4aqVHCyHOv5PdcKsPPg=; b=T3863WsIlo0C5XeEF/cDfFQ+bQfhECVF3o4vsHW0aDI4dxujysucYx8xkbLwd2Sunt cAfEBMYtXiS4pVblUW4cZFcS3irXp9iQNaMQt+fmcfKADIC7XxXnuEES+0UUJUn+dmWa NBjRPMxcAALTvED64L5uL75GWehP7TY7F5FMmmaNk4AYWwP4b92VXjMKxguk6qhopIWW hBupXOtgfHTRReJDEwnfeW9Kc4ZgdRWG5ox4oNd/SdGy2oAdaU3SLLZozPk1Id2jqVSd fXTJvi8GSrMlOlseT+oODD2RXLLbVcjx4inHYqWIUfKM+e95VP8BuqUUdpxx3IgEgOmo uvRQ== X-Gm-Message-State: ACgBeo0NcaK5Tf9/MaMpaFHcxL+rumk4hsIs1LHa5o0gKhMmUFSn0I1L GuPlJST18GOnKjSELx9IeHwUqMFR3JA8YoA/+L/DO4tTRmVFgHY4X1z73Tnb5scpWPSkExXQe2b pnjeJYv60GGrXjXHxAyAlQFNebb758NhQWis3PLVqgf8KgR+Aj6jQHlYRC+/T0nBeVaDFuBnGfe dzCutp8SHoOr8ByrBGJJQIa0zzg0PBClC9mTJ5zhGDwr79PlMWDkKz X-Google-Smtp-Source: AA6agR4Xg3DjRjnoW8Z+J8wmAOLhQWwgjZ37BEW7buIRuccAGxcVvM40UrOMr29llALBWBfBElpsrw== X-Received: by 2002:a05:600c:354a:b0:3a5:b01b:2ab0 with SMTP id i10-20020a05600c354a00b003a5b01b2ab0mr8858960wmq.61.1662329690665; Sun, 04 Sep 2022 15:14:50 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-229-52.bb.vodafone.cz. [86.49.229.52]) by smtp.gmail.com with ESMTPSA id e27-20020adf9bdb000000b0021f0ff1bc6csm726453wrc.41.2022.09.04.15.14.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Sep 2022 15:14:50 -0700 (PDT) Message-ID: <2d5d480b-d9e5-9d8f-dbca-ad6ec22a1b75@enterprisedb.com> Date: Mon, 5 Sep 2022 00:14:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: POC: GROUP BY optimization Content-Language: en-US To: "Jonathan S. Katz" , David Rowley Cc: Michael Paquier , Zhihong Yu , "Andrey V. Lepikhov" , Teodor Sigaev , Tomas Vondra , PostgreSQL Developers References: <721b3ff9-f214-f5d4-86c7-bae515bbec18@enterprisedb.com> <9af89543-3d17-4c98-59de-1daa5bceeb06@enterprisedb.com> <9408e450-60c6-6fbc-d5c4-467bb0abfe67@postgrespro.ru> <44472925-f6c6-e8de-6f72-0451458532c4@enterprisedb.com> <7a80a207-5e8e-b80c-476c-2d290b0526e9@enterprisedb.com> <65941e87-86c1-c09c-8ad5-8e102aebe8ee@enterprisedb.com> <683635b8-381b-5b08-6069-d6a45de19a12@enterprisedb.com> <77b83b6d-bdb4-614d-4e7d-235ee72e2599@postgresql.org> <217ab546-4c78-9364-9282-a6dcefa066ea@enterprisedb.com> <9e564f8b-2c4b-6c6f-9334-e76e69af8f84@postgresql.org> From: Tomas Vondra In-Reply-To: <9e564f8b-2c4b-6c6f-9334-e76e69af8f84@postgresql.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 9/1/22 16:05, Jonathan S. Katz wrote: > On 9/1/22 9:06 AM, Tomas Vondra wrote: >> >> >> On 8/30/22 15:15, Jonathan S. Katz wrote: >>> On 8/18/22 3:29 AM, Tomas Vondra wrote: >>>> >>>> >>>> On 8/18/22 03:32, David Rowley wrote: >>> >>>>> Here are a couple of patches to demo the idea. >>>>> >>>> >>>> Yeah, that's an option too. I should have mentioned it along with the >>>> cpu_operator_cost. >>>> >>>> BTW would you mind taking a look at the costing? I think it's fine, but >>>> it would be good if someone not involved in the patch takes a look. >>> >>> With RMT hat on, just a friendly reminder that this is still on the open >>> items list[1] -- we have the Beta 4 release next week and it would be >>> great if we can get this resolved prior to it. >>> >> >> I know. I'll fix this by tweaking one of the cost gucs, mentioned by >> David. > > Great -- thanks for the update! > I've pushed the fix to 15+master. In the end I just used David's patches that set parallel_setup_cost to 0. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company