pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Mikhail Balayan <mv.balayan@gmail.com>
Cc: pgsql-performance@postgresql.org, Laurenz Albe <laurenz.albe@cybertec.at>
Subject: Re: Planning time is time-consuming
Date: Mon, 11 Sep 2023 10:27:13 -0400
Message-ID: <2563519.1694442433@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvog5X-fOcrR4y8EhK483MXM8d8ApXwevGBvPRg6azwqbg@mail.gmail.com>
References: <CAC2oM1bUqsBFQKVrZy9Z95SuDbmj-uSkXdbYfTnRwyTACSmd4w@mail.gmail.com>
	<5ef3acf5733d5a8584b09eb5dd107e59aa87a075.camel@cybertec.at>
	<CAC2oM1Z6xrxxbBwT8EnL3eGwtjJpqppY=xozYxLpL9VT1UUSLw@mail.gmail.com>
	<CAC2oM1bq_18FJBK7zjKVjTgQ30nMS37XJ1EM8cDQTpds3Phkwg@mail.gmail.com>
	<CAApHDvog5X-fOcrR4y8EhK483MXM8d8ApXwevGBvPRg6azwqbg@mail.gmail.com>

David Rowley <dgrowleyml@gmail.com> writes:
> I'm not sure if you're asking for help here because you need planning
> to be faster than it currently is, or if it's because you believe that
> planning should always be faster than execution. If you think the
> latter, then you're mistaken.

Yeah.  I don't see anything particularly troubling here.  Taking
circa three-quarters of a millisecond (on typical current hardware)
to plan a four-way join on large tables is not unreasonable.
In most cases one could expect the execution of such a query to
take a good bit longer than that.  I think the OP is putting too
much emphasis on an edge case where execution finishes quickly
because there are in fact zero rows matching the uuid restriction.

BTW, in addition to the duplicative indexes, I wonder why the
uuid columns being joined on aren't all of "uuid" type.  While
I doubt fixing that would move the needle greatly, it still
seems sloppy.

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <2563519.1694442433@sss.pgh.pa.us>
Permalink:  ../2563519.1694442433@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2563519.1694442433@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, mv.balayan@gmail.com, laurenz.albe@cybertec.at
  Subject: Re: Planning time is time-consuming
  In-Reply-To: <2563519.1694442433@sss.pgh.pa.us>

* 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