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 1txhyP-00DWFc-Di for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2025 07:48:21 +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 1txhyM-001Vxt-3a for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Mar 2025 07:48:18 +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 1txhyL-001Vwn-OW for pgsql-hackers@lists.postgresql.org; Thu, 27 Mar 2025 07:48:17 +0000 Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1txhyK-001OOl-0R for pgsql-hackers@postgresql.org; Thu, 27 Mar 2025 07:48:16 +0000 Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-e60aef2711fso499306276.2 for ; Thu, 27 Mar 2025 00:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743061694; x=1743666494; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=YfzLBT/Xelv23sHiluPKbnHtfMUPmsoLnJmKONTGsUE=; b=G7Hy1FCqGZy+9R+flOs/x33LCJFNDtehUnz0ebIknhn9ZLo9KiNLkY9UFYG43OsQYO OU7IxuV0bzsNQfIRfFIX1c9b1iA40gCXKHNNkacFAEfKJPB0xPgGm9p3pR7nLKiYH7Vi fPoqHuIry1LepQwcl8K1mDOtYGrY6jGx7bcR2N1Eh7M458/GVMy91llo2xRjqYcL5sS3 cFHHe0sZ5xqgxTnph2I0ghJAoh+o+K5zr6DNgbbse3Itgl6g4rxyrwCzmvSNg6GgW/yB +8zXjy7+1D07k7R3+00m3ZGBeY+Metp9mLKU3UzquvLLQsCS5VkVMUyoXvcyQ5ftmlIg AxaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743061694; x=1743666494; h=content-transfer-encoding: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=YfzLBT/Xelv23sHiluPKbnHtfMUPmsoLnJmKONTGsUE=; b=eAJ1n1hN9vLZT3PoL4mOLgk836RYgcZb+6vkMhO85/IZYMJsVzQjGHvPAdIL8/tGGV 5r9Br/x5ZhFG7l3Gn2CU7QQm/rnQIPdbQL5RRiYPRhqo8muoUbmYlSG0KWMLEK3pMQu5 asUwC7XY9xNb5+yOWhQYE+TfITNN8MndieKM0Pn3SXbyCGFhFQxsqQuKFEBSRF4GnARu u8UtixxihHdwkwZfiOl/7lvVvTTiAGSHmD1GG70T3CAtkFa1H1rkskz85/K1DT1Cdwib v6Lg74DcKDXGLCddzrEaSjULcrUFd1Y+Mo8UCDhVTpvCgTgC+f+ae2evQIg8AhlW02ai 9h1w== X-Gm-Message-State: AOJu0YzrVjGUqYdM8E2cWu4v6dpxA8NTIZWJ2MWVre2S9DNmT7cxBcmp xzAt/X0vp6hTT2SCY5Hku8Q6a0PTRdB7FGaJrxQo5kzvSsNNvaMDwRDSIiDN2VhBhgvHbI3a8l2 EfMTYfElaZGosjcjsGxXdDk4AuLBjWDHw X-Gm-Gg: ASbGncu4sNVlKkMynXpyZ0/LVBe8T5NJv68+LVjOnnP0rUXg/Y+Webw0clH3prjQgi4 /iJwSOE8hYhA0oir0D31hTmd6naf6MVSJKGMd+e84RSeBk2LdfK/qMxiv6g1b1DqFiZSx2UtuYg 3nsQpm69i2f3eRTI37VJUooszMgC936SLKOwjBEvxLg4P0PPc+KSEK5R6MiEjl X-Google-Smtp-Source: AGHT+IHcaFJGCAbQxtWx1p8mbWmwuYylTtavrpkYJwB3lcX16jv5g2SWdtQr50IMJzIxLBjCoRGI8tLVjYnzS6N8Ba8= X-Received: by 2002:a05:6902:1684:b0:e64:5df:ad with SMTP id 3f1490d57ef6-e694350fd82mr3533937276.6.1743061694225; Thu, 27 Mar 2025 00:48:14 -0700 (PDT) MIME-Version: 1.0 References: <7cdf4ecd-8789-4d85-ab59-2b78d4d27b1f@tantorlabs.com> In-Reply-To: <7cdf4ecd-8789-4d85-ab59-2b78d4d27b1f@tantorlabs.com> From: Richard Guo Date: Thu, 27 Mar 2025 16:48:03 +0900 X-Gm-Features: AQ5f1JpgKqCATQOIgYwzayhW1W-spuYRDW8BBTww98-75RBLDM90sISWmCI45mc Message-ID: Subject: Re: Remove vardata parameters from eqjoinsel_inner To: Ilia Evdokimov Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Feb 21, 2025 at 7:04=E2=80=AFPM Ilia Evdokimov wrote: > When calculating selectivity for an inner equijoin, we call > eqjoinsel_inner, which uses unused parameters vardata1 and vardata2. > These parameters might have been left behind accidentally when we moved > getting sslots out of the function. I suggest removing them, as they can > be added back at any time if needed. I attached patch with fixes. Yeah, these parameters haven't been used since a314c3407, when we moved get_variable_numdistinct and get_attstatsslot out of eqjoinsel_inner and eqjoinsel_semi to avoid repetitive information lookup when we call both eqjoinsel_inner and eqjoinsel_semi. I'm wondering whether we should also remove parameter vardata1 from eqjoinsel_semi. vardata2 is still needed though to clamp nd2 to be not more than the rel's row estimate. Thanks Richard