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 1u22VK-00BzyQ-W6 for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 06:32: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 1u22VJ-006WGV-EI for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Apr 2025 06:32:13 +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 1u22VJ-006WGK-4b for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 06:32:13 +0000 Received: from mail-yb1-xb32.google.com ([2607:f8b0:4864:20::b32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u22VH-003cia-2k for pgsql-hackers@lists.postgresql.org; Tue, 08 Apr 2025 06:32:12 +0000 Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-e6dea30465aso4448515276.1 for ; Mon, 07 Apr 2025 23:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744093931; x=1744698731; darn=lists.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=PiPlClUSN+Ne/bPnmSBeYfs18cU/jh9ylrC+C+yiOHs=; b=KXemSHMEfmqRe/rf7yds57mCLArKm6+D5koue/eAQSCfH+EkYoU6e3k3lXsUXAPxMf mGsoEzjZvBAHPpgrnY+Yp17Afc6CL0FHw89gBUtDSHmmiiN3HGygFO6W+fZniJYvYYeI J15RACDKQfqKVlyu1zk3jE1Bv2rTX9tgDxjA6KtxX+M0fzxDKJMt0V8UZtiGMwYqdx79 NDDYkKqRD6Swsy3VdoCs0Z/SATzejZc7fdTPmGLcHgiyHXolu9QeKfKrL1zO0kymq/ht QB/6Q8o7xUvrNQogb5DN2Xd9U4+JjvV0b5vGG4nhYlqkMXKEUhEEPple6ISAPmOAkxTi Mexg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744093931; x=1744698731; 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=PiPlClUSN+Ne/bPnmSBeYfs18cU/jh9ylrC+C+yiOHs=; b=iz5bXWvX4WUDJLcTlFlreA+HwA/XcBhnOI5ZK3gnpfZlaB0428XxRICityI2cCtlnH HgIqpaUwTVlElF3Lwrg4cDc/RzTwQvPF7ApE9/pVsIgL/+mOVpbipon914yJZ/7oFW13 1AWV5RALv0SGHLQ3Jr3tv5w14M7HVOgZJAkN45DwJFzzwESvErgJZuOHIElBwhPg1Evo tsp2dYbg0ZtV+CEboAn8aAx8kb2C6+gK1IAUr9U5DQmQS/zruhCOZZQy59yhYBaofrB6 tFlIOjjw5KRPVfTBuYEP5Gv9sRglSTbFT9Ey0FfKzXVj43bVL9q6E56Zn2KvSY0eqaAZ WDug== X-Gm-Message-State: AOJu0YwHjki+VMg+/W/EEAW9ivaP+EIHxwzDMcI4OVLn7KH22LVQAZ0V febpXq3FTCKt6aUz5tue4975iwxBsYCdPZ6QukF3uAFuDX/igm8YOXtN7/OCAjQtlUgK/SJP72+ mC1298T8E/tdDhRIqcFpLcthEGSg= X-Gm-Gg: ASbGncsa/cB+7+fmM1I8Lp+MYyXAFlrUh4T/fhZtRwvQuPlQJJGfxFBuGvsEn8magVK BKxPnstcSioRQRvSWaOcGvpC8f1taBMC9rZp94Y3XrwiVH/EK4KHIT4huRtekkJoRHk+0Mh2dyo 6D+P1OxU9FdUbkMnQQT1drZoplzQU/QY7IYodY2Tm71Y0rePbGgOq/zCyzhMhB X-Google-Smtp-Source: AGHT+IEQff8sXYbScb/Te0M1atxwIxnoUwX/IXaW9AIvkZI4g7//Qf4/xSCtCF9+XtKOH9ZbLj1IAYvt/uh66cDu5CE= X-Received: by 2002:a05:6902:2205:b0:e63:ebbf:7e6 with SMTP id 3f1490d57ef6-e6e318e97eemr16222110276.41.1744093930963; Mon, 07 Apr 2025 23:32:10 -0700 (PDT) MIME-Version: 1.0 References: <7ba688e1-7091-4262-991f-a9162254065a@gmail.com> In-Reply-To: <7ba688e1-7091-4262-991f-a9162254065a@gmail.com> From: Richard Guo Date: Tue, 8 Apr 2025 15:32:00 +0900 X-Gm-Features: ATxdqUHuBBsqJbaXzbyd2YF3SbIc9QdMQ9lqYvbpZqx6rQY6oFin0Zo-WBBarcg Message-ID: Subject: Re: An incorrect check in get_memoize_path To: Andrei Lepikhov Cc: Pg 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 Mon, Apr 7, 2025 at 9:54=E2=80=AFPM Andrei Lepikhov = wrote: > On 4/7/25 09:50, Richard Guo wrote: > > Consider the join to t3. It is a unique join, and not all of its > > restriction clauses are parameterized. Despite this, the check still > > passes. > At the same time I think term 'Incorrect' is not good unless you show an > example where data returned is not consistent to the expected. > I think this inequality check has worked in couple with the > get_equal_hashops. Do you mean this check is designed to work in conjunction with the clause_sides_match_join check in paraminfo_get_equal_hashops? I would consider this a very poor design. The purpose of this check is simply to verify whether all restriction clauses are parameterized. I don't understand why it needs to depend on paraminfo_get_equal_hashops in such an unexpected way to function correctly. I can't see any advantage to this design, other than that it's prone to bugs. Moreover, in the case where not all restriction clauses are parameterized, why waste CPU cycles running all the code after the check only for paraminfo_get_equal_hashops to catch it later? Additionally, I couldn't find any comments explaining this unusual behavior, either in the check itself or in paraminfo_get_equal_hashops. Thanks Richard