Re: Optimizer failed to generate plan

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: xianliang(dot)ji(at)esgyn(dot)cn
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Wang Xiao-Zhong <xiaozhong(dot)wang(at)esgyn(dot)cn>, Guo Heng <heng(dot)guo(at)esgyn(dot)cn>
Subject: Re: Optimizer failed to generate plan
Date: 2023-02-13 11:40:30
Message-ID: CAApHDvq=MvEosOWazo45YFTkmuOD0qv1_Tz4dvcgem2aDraaDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, 14 Feb 2023 at 00:18, <xianliang(dot)ji(at)esgyn(dot)cn> wrote:
> postgres=# select a.*,b.* from EMP a FULL JOIN DEPT b on
> a.deptno=b.deptno OR upper(ename)='BLAKE' where a.job='MANAGER' OR
> b.dname='SALES';
> ERROR: FULL JOIN is only supported with merge-joinable or hash-joinable

It's not a bug. The problem is the join condition has OR conditions
and we can do a full Hash or Merge join for joins like that.

I'm a bit unclear on what you need exactly, but maybe you could get it
by repeating the query once for each branch of the OR and then
performing a UNION ALL.

David

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2023-02-13 12:00:00 Re: array_agg(DISTINCT) caused a segmentation fault
Previous Message David Rowley 2023-02-13 10:41:06 Re: array_agg(DISTINCT) caused a segmentation fault