pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Marc Millas <marc.millas@mokadb.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pb with join plan
Date: Wed, 21 Jun 2023 12:43:33 +0200
Message-ID: <e5803c59-3a8a-927b-4660-9d55623b9ca5@enterprisedb.com> (raw)
In-Reply-To: <CADX_1aaVGTJiU-Fw+vsEF-iTNYxqq9fDtvw9nb_iW9zgP0Bk8Q@mail.gmail.com>
References: <CADX_1aYjA-xZcg+CTq7m++WxjZ7HvHA5=hnhedKNF0TypK6j1Q@mail.gmail.com>
	<CAApHDvoEuNtDP9=_eRh=bBvZ+dKVBBQbB5x77caHn2Wva1UtPQ@mail.gmail.com>
	<CADX_1abVROy4x1_drTZNhgm4O9XXu02QPK-8tDktTap11zPcAg@mail.gmail.com>
	<CAApHDvq0KeGPMkpwytOBYnYuQ+ji4txCyMmnmVExLcRBMLFT2A@mail.gmail.com>
	<CADX_1aaVGTJiU-Fw+vsEF-iTNYxqq9fDtvw9nb_iW9zgP0Bk8Q@mail.gmail.com>

On 6/21/23 00:26, Marc Millas wrote:
> 
> 
> On Tue, Jun 20, 2023 at 11:19 PM David Rowley <dgrowleyml@gmail.com
> <mailto:dgrowleyml@gmail.com>> wrote:
> 
>     On Wed, 21 Jun 2023 at 08:34, Marc Millas <marc.millas@mokadb.com
>     <mailto:marc.millas@mokadb.com>> wrote:
>     >
>     > On Tue, Jun 20, 2023 at 10:14 PM David Rowley
>     <dgrowleyml@gmail.com <mailto:dgrowleyml@gmail.com>> wrote:
>     >>
>     >> On Wed, 21 Jun 2023 at 07:42, Marc Millas <marc.millas@mokadb.com
>     <mailto:marc.millas@mokadb.com>> wrote:
>     >> > But if I do the same with clause one OR clause 2, I have to 
>     kill the request after an hour, seeing the filesystem showing more
>     than 140 Mb of increased usage.
>     >>
>     >>
>     > link to the anonymized plan of the req with one clause :
>     https://explain.depesz.com/s/TWp4 <https://explain.depesz.com/s/TWp4;
> 
> link to the plan with the second
> clause alone: https://explain.depesz.com/s/byW5
> <https://explain.depesz.com/s/byW5> 
> link to the plan with both clauses ORed (the one not
> finishing) https://explain.depesz.com/s/jHO2
> <https://explain.depesz.com/s/jHO2;
> 
> 
> 
>     It's quite difficult to know what the problem is you want to fix here.
>     Your initial post indicated it was the query with the OR condition
>     that was causing you the problems, but the plan you've posted has no
>     OR condition?!
> 
>     You're more likely to get help here if you take time to properly
>     explain the situation and post the information that's actually
>     relevant to the problem you're having, or state the problem more
>     clearly, as there's a mismatch somewhere.
> 
>     It might also be worth having a look at
>     https://wiki.postgresql.org/wiki/Slow_Query_Questions
>     <https://wiki.postgresql.org/wiki/Slow_Query_Questions; . EXPLAIN is not
>     going to tell us what part of the query is slow. I'll let the wiki
>     page guide you into what to do instead.
> 
>  
> I know that page. obviously, as I have to kill the request, I cannot
> provide a explain analyze... 
> 

It's a bit weird the "victor" table is joined seemingly without any join
conditions, leading to a cross join (which massively inflates the cost
for joins above it). Maybe the anonymized plan mangles it somehow.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (11+ messages)  latest in thread

Message-ID: <e5803c59-3a8a-927b-4660-9d55623b9ca5@enterprisedb.com>
Permalink:  ../e5803c59-3a8a-927b-4660-9d55623b9ca5@enterprisedb.com/
Also on:    postgresql.org/message-id/e5803c59-3a8a-927b-4660-9d55623b9ca5@enterprisedb.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, marc.millas@mokadb.com, dgrowleyml@gmail.com
  Subject: Re: pb with join plan
  In-Reply-To: <e5803c59-3a8a-927b-4660-9d55623b9ca5@enterprisedb.com>
  References: <CADX_1aYjA-xZcg+CTq7m++WxjZ7HvHA5=hnhedKNF0TypK6j1Q@mail.gmail.com> <CAApHDvoEuNtDP9=_eRh=bBvZ+dKVBBQbB5x77caHn2Wva1UtPQ@mail.gmail.com> <CADX_1abVROy4x1_drTZNhgm4O9XXu02QPK-8tDktTap11zPcAg@mail.gmail.com> <CAApHDvq0KeGPMkpwytOBYnYuQ+ji4txCyMmnmVExLcRBMLFT2A@mail.gmail.com> <CADX_1aaVGTJiU-Fw+vsEF-iTNYxqq9fDtvw9nb_iW9zgP0Bk8Q@mail.gmail.com> <e5803c59-3a8a-927b-4660-9d55623b9ca5@enterprisedb.com>

* 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