Re: incorrect results and different plan with 2 very similar queries

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Dave Cramer <davecramer(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: incorrect results and different plan with 2 very similar queries
Date: 2024-03-27 21:56:54
Message-ID: CAApHDvqp-Cy3sY8dGPL-zyECCVBjrBN+WrCGg-k5cqU1NegGSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 28 Mar 2024 at 10:33, Dave Cramer <davecramer(at)gmail(dot)com> wrote:
> There is a report on the pgjdbc github JDBC Driver shows erratic behavior when filtering on CURRENT_DATE · pgjdbc/pgjdbc · Discussion #3184 (github.com)
>
> Here are the plans.
>
> JDBC - Nested Loop (incorrect result)
>
> Index Cond: (mutation >= ((CURRENT_DATE - '1971-12-31'::date) - 28))

> JDBC - Hash Right (correct result)
>
> Recheck Cond: (mutation >= ((CURRENT_DATE - '1971-12-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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-03-27 22:00:10 Re: Popcount optimization using AVX512
Previous Message Thomas Munro 2024-03-27 21:52:01 Re: Streaming I/O, vectored I/O (WIP)