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 1rpbGh-007VNz-C8 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 21:57:11 +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 1rpbGf-0038YV-UF for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 21:57:09 +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 1rpbGf-0038YN-Kp for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 21:57:09 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rpbGc-006rCN-U5 for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 21:57:08 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-513d599dbabso322630e87.1 for ; Wed, 27 Mar 2024 14:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711576626; x=1712181426; 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=Ngr7y3gvdaBiWQX8Nd0dbhNSxUwyohGG6B0LzQaSgQQ=; b=I+OK+6/1T7pv+yqS9oivlnSng+BANrWsnBYQVunAv+9JmqaZrr/khFPzUmL6V1WdTA sElshLY430sCV2j3GuMJnpb+R3BSjOaHzpap4dlLNQk/1BIUFqV8JfzzOShKc1oQbBqe k8NjId4g6G2yCz6yNdx6rgHoibYoPr1NiRiFH/qdEuhdJDzU6lR+Myu8S3QtHvZ61PRo nl+Kqrb/8CO9c0zY0fRagUrpIiZwmiAyOtBf1SRNxMs98khG0ySsupFxDcoT4gZ2n8uM m9DNisVNEkAIDV/GylTOhExoKCY0mk6Kk5rQvo4P2myJHXb5Tjg34nQs+6a6RaOQY+k5 XlRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711576626; x=1712181426; 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=Ngr7y3gvdaBiWQX8Nd0dbhNSxUwyohGG6B0LzQaSgQQ=; b=vacjlD7ovG3w7hceuNJQL58t4GDlWR3FktFb77HctnRPn9cB24/ir66d6bdQcpa8iC p4f1MIKgHAIrjuYlPdwowIJkKQDAt1Pyd6Q5R3id6PoZrRxe3k/r+6HFKHQzQkU7+HQy Xxo7R/q3FEbnmtYdJJxslTkpgLTafzbZqJE331mtmSuCBVrrk6Lnr8zmFDyyrgce56Vj YjO66mm+R04GpwQsmCwjo5a2stiwGRk6ebXMFRW9h7JR+aHBS9MR+ZFtqykbqIHZHfwz 5FhTQelj1zQzwfNBOc0KSN7DSUbSxLU7aunn/u8pzOj/MjPFEESMSkszHPYwG+NAXDk8 iyrA== X-Gm-Message-State: AOJu0YyC0f0Nkhi7y178rcb9ktLOI0cxjfTRK7USoB8Llfmc8wpX1NOe 0YREYYmWhq3YZILHSrwaPTEOfyzdjP3CVFakYsC7hnUlHvG88Y6nCqFpZ/WAd3cksyGBhaW71My pwS/2N7ClnoNblD7At91A3BNsLTU= X-Google-Smtp-Source: AGHT+IE4YWBdSmaSEiTkr9abtQik5HShs/L9avJOP+fg1IimBOF6q5u8xWuMLIxpOCFP8TZ41Yma0VkfbeRKQwVZMFE= X-Received: by 2002:a05:6512:3711:b0:513:aef9:7159 with SMTP id z17-20020a056512371100b00513aef97159mr494685lfr.39.1711576625817; Wed, 27 Mar 2024 14:57:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Rowley Date: Thu, 28 Mar 2024 10:56:54 +1300 Message-ID: Subject: Re: incorrect results and different plan with 2 very similar queries To: Dave Cramer Cc: PostgreSQL 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 Thu, 28 Mar 2024 at 10:33, Dave Cramer wrote: > There is a report on the pgjdbc github JDBC Driver shows erratic behavior= when filtering on CURRENT_DATE =C2=B7 pgjdbc/pgjdbc =C2=B7 Discussion #318= 4 (github.com) > > Here are the plans. > > JDBC - Nested Loop (incorrect result) > > Index Cond: (mutation >=3D ((CURRENT_DATE - '1971-12-= 31'::date) - 28)) > JDBC - Hash Right (correct result) > > Recheck Cond: (mutation >=3D ((CURRENT_DATE - '1971-1= 2-31'::date) - 29)) I don't see any version details or queries, but going by the conditions above, the queries don't appear to be the same, so different results aren't too surprising and not a demonstration that there's any sort of bug. David