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 1tVj1U-00At9d-MX for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jan 2025 03:15:53 +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 1tVj1T-00Aouf-Pl for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Jan 2025 03:15:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVj1T-00AouV-G7 for pgsql-hackers@lists.postgresql.org; Thu, 09 Jan 2025 03:15:51 +0000 Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tVj1Q-000egt-17 for pgsql-hackers@lists.postgresql.org; Thu, 09 Jan 2025 03:15:50 +0000 Received: by mail-vk1-xa30.google.com with SMTP id 71dfb90a1353d-518ae5060d4so152036e0c.0 for ; Wed, 08 Jan 2025 19:15:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736392547; x=1736997347; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oBWpyQCOzimEvZf8hOhImiIlkcRkzULYsKXRfa/dGkw=; b=Pvv+u1HS/jbjGKzbF1dkliEp48fySHw9wLIzo7hCDDGGHOSP7vJumqSr5LvDg1pQ6f rIjVuLz8b+jjnCbia8MdMTNQHjYgUM+hn/+9Xhx7o7P1gTR6uucdOCWPEE94ZkP5olJW LcB9wumAvAByzRcOu3u2/tfXKQfoPuDqXNOucjbHQ9uwySFMTF5oxVLnmEbbKSS6Ctk+ eKitphjPkLFXvdMvvmcU2euqB461gHC6CXL0xIKf2j/HM30GNqgl3ehuLLWkv3qhSjvU R2zeKEf+PNJ+Kp1X3vEJdD5ujzT1+hQgHyLI+9HpLedMkwuxAkGFUw6mV+VIiZhyj4LK uEOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736392547; x=1736997347; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oBWpyQCOzimEvZf8hOhImiIlkcRkzULYsKXRfa/dGkw=; b=isxPgT+YZ/iKQcqPa4oE4tewWCEdkOjVwG223swD/WUz8QcmuFEREdYFm3ZA2oJyfF 2I0iaD2FdMhnKY/XFgESpyZiiY8Dx6EilP2tEE7pifBSxn6OcAFRI/XdeWrCcAbMVo86 UHjD8WKXRAs1kmMO/zwsDzj6hMLyqHWquULChJe9qnCta0nBO8+6oEmrRqPceHIOAlQO CWvfEYqAzhj3qdWKckknyOXKu+tARJcj4uhYAURce9QLwghedFDvqERE5cteWed7t9DR rVcwgAhDffecRSGldLeEfktsFv0rbaoa+90w5PJARldJnaBQSfFfKBTZhYmbmfjXkO9y E+rg== X-Forwarded-Encrypted: i=1; AJvYcCX/KX88pabLXNupb0gEEgEa37RL+fHU7hZn+XN3rYILesOufdM/7Cw7YAitAQqGtvLf3lE7w53VfgU8hocR@lists.postgresql.org X-Gm-Message-State: AOJu0Yw5y+A9w51X4PQjyIys7xkJVQZbcuO8bZZrZmUkdBYMO8k0OzBZ ml/nEZG3zBJVnKGu+iCgc8+u6LVlRdv2KgPNLJlocdSFokh8OT+rYHXs8z0XcM3Ud3mg7p0vwh2 90EJFmiCiaej2VMFlHSnf+GX4+R0= X-Gm-Gg: ASbGnctWQ+8UzO5SHsddfVOvib4NemQwPKQ7Vi0nmwr7MhK6ZhEh0PXtP3DEAt3VJba HnFYoJdWae6g27orsTweFKaPZ2L+g3utS/Njm X-Google-Smtp-Source: AGHT+IGOl53dY6s3YsPh7Y3AmKiDwk5UTKbOgHTAG5TJKq4hW5NBZHYdMX0QH2+Kx4HHRjrIcJziMykDh+nRERYTODE= X-Received: by 2002:a05:6122:458b:b0:518:8bfe:d5f0 with SMTP id 71dfb90a1353d-51c6c2b3d25mr3871391e0c.0.1736392547390; Wed, 08 Jan 2025 19:15:47 -0800 (PST) MIME-Version: 1.0 References: <87il22cj51.fsf@163.com> In-Reply-To: From: jian he Date: Thu, 9 Jan 2025 11:15:09 +0800 X-Gm-Features: AbW1kvaA9DSbaHL3JsY4969_rgFde90arY_u9ctX_YGQA-XTP331mnK3eUJ8Q7s Message-ID: Subject: Re: Eager aggregation, take 3 To: Richard Guo Cc: Robert Haas , Tender Wang , Paul George , Andy Fan , PostgreSQL-development , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. in create_grouping_expr_infos tce = lookup_type_cache(exprType((Node *) tle->expr), TYPECACHE_BTREE_OPFAMILY); if (!OidIsValid(tce->btree_opf) || !OidIsValid(tce->btree_opintype)) return; .... /* * Get the operator in the btree's opfamily. */ eq_op = get_opfamily_member(tce->btree_opf, tce->btree_opintype, tce->btree_opintype, BTEqualStrategyNumber); if (!OidIsValid(eq_op)) return; eq_opfamilies = get_mergejoin_opfamilies(eq_op); if (!eq_opfamilies) return; btree_opfamily = linitial_oid(eq_opfamilies); If eq_op is valid, then we don't need to call get_mergejoin_opfamilies? since get_mergejoin_opfamilies output will be the same as tce->btree_opf. and we already checked (tce->btree_opf) is valid. In other words, I think eq_op is valid imply that tce->btree_opf is the value (btree opfamily) we need.