Re: Potential performance issues

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Potential performance issues
Date: 2021-03-01 14:44:02
Message-ID: 5fcce4e3-3ee7-e516-91a6-1883def57de8@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jung, Jinho schrieb am 28.02.2021 um 16:04:
> # Performance issues discovered from differential test
>
> For example, the below query runs x1000 slower than other DBMSs from PostgreSQL.
>
>     select ref_0.ol_amount as c0
>     from order_line as ref_0
>         left join stock as ref_1
>           on (ref_0.ol_o_id = ref_1.s_w_id )
>         inner join warehouse as ref_2
>         on (ref_1.s_dist_09 is NULL)
>     where ref_2.w_tax is NULL;

I find this query extremely weird to be honest.

There is no join condition between warehouse and the other two tables which results in a cross join.
Which is "reduced" somehow by applying the IS NULL conditions - but still, to me this makes no sense.

Maybe the Postgres optimizer doesn't handle this ugly "join condition" the same way the others do.

I would rather expect a NOT EXISTS against the warehouse table.

Thomas

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rick Otten 2021-03-01 14:53:49 Re: Potential performance issues
Previous Message Jung, Jinho 2021-03-01 14:41:22 Re: Potential performance issues