pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-performance@lists.postgresql.org
Subject: Re: Potential performance issues
Date: Mon, 1 Mar 2021 15:44:02 +0100
Message-ID: <5fcce4e3-3ee7-e516-91a6-1883def57de8@gmx.net> (raw)
In-Reply-To: <BN6PR07MB313763C4040616159DE1B6FBEE9B9@BN6PR07MB3137.namprd07.prod.outlook.com>
References: <BN6PR07MB313763C4040616159DE1B6FBEE9B9@BN6PR07MB3137.namprd07.prod.outlook.com>

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





view thread (10+ messages)  latest in thread

Message-ID: <5fcce4e3-3ee7-e516-91a6-1883def57de8@gmx.net>
Permalink:  ../5fcce4e3-3ee7-e516-91a6-1883def57de8@gmx.net/
Also on:    postgresql.org/message-id/5fcce4e3-3ee7-e516-91a6-1883def57de8@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: shammat@gmx.net, pgsql-performance@lists.postgresql.org
  Subject: Re: Potential performance issues
  In-Reply-To: <5fcce4e3-3ee7-e516-91a6-1883def57de8@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox