Re: QUAL Pushdown causes ERROR on syntactically and semantically correct SQL Query

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Hans Buschmann <buschmann(at)nidsa(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: QUAL Pushdown causes ERROR on syntactically and semantically correct SQL Query
Date: 2023-06-05 14:55:57
Message-ID: CAKFQuwZUh4Tn5aJerXuQjRn221xhTbgRqUF14Ng42FYaOrWu2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 5, 2023, 07:40 Hans Buschmann <buschmann(at)nidsa(dot)net> wrote:

> I have reworked the case of BUG #17842 to include the data and the
> questions for further investigation.
>
>
> The problem is NOT to correct the query to a working case, but to show a
> fundamental problem with qual pushdown.
>

The optimization system operates with imperfect information, meaning it
assumes expressions do not produce errors depending on the data. If you
know certain data can produce errors you need to add the relevant code to
avoid evaluating those expressions on those data.

Yes, or would nice if PostgreSQL could do better here. The cost of doing
so is quite high though, and there is no interest in incurring that cost.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-06-05 15:15:59 Re: QUAL Pushdown causes ERROR on syntactically and semantically correct SQL Query
Previous Message Heikki Linnakangas 2023-06-05 14:51:57 Let's make PostgreSQL multi-threaded