Re: BUG #16886: string equivalence predicate causes system slowdown

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: liuxy(at)gatech(dot)edu, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16886: string equivalence predicate causes system slowdown
Date: 2021-03-01 11:25:01
Message-ID: CAMbWs4-p-j04L7AHzEnMhknG0W-bZdB8k26x88b2Zd8S+NsdpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Tue, Feb 23, 2021 at 5:26 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

>
> Actual Behavior
> We executed both queries on the TPC-H benchmark of scale factor 5: the
> first
> query takes over 23 seconds, while the second query only takes 1.4 seconds.
> We think the time difference results from different plans selected.
> Specifically, in the first (slow) query, the optimizer does not push the
> predicate through the LEFT JOIN operator.
>

Well, in the first (slow) query, the qual "nation.n_name IS NOT distinct
FROM 'ALGERIA'" is not considered as strict. So it cannot be used to
reduce the left outer join here. Meanwhile, since it is a qual above the
outer join and references nullable Var 'nation.n_name', it cannot be
pushed down below the outer join, otherwise we would have unexpected
null-extended rows from the outer join.

Thanks
Richard

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-03-01 12:15:41 BUG #16907: Performance issue after big table drop and recreate
Previous Message java reddy 2021-03-01 10:19:20 After upgrade from 9.4.1-3 to 10.15 and fresh install of 10.15 have some differences in the schema definition