public inbox for [email protected]  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <[email protected]>
To: yudhi s <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: Query performance issue
Date: Thu, 24 Oct 2024 10:01:21 -0400
Message-ID: <CAKAnmmL_=6PjxSJD105oSSfEPiCyk_KQp5ZCPz2AsdunznOXeA@mail.gmail.com> (raw)
In-Reply-To: <CAEzWdqe9U7zXSuDPpT8O_E=GykZx=3ttVEwU5wMN0AnFARSZxg@mail.gmail.com>
References: <CAEzWdqfeaLov=e3Dk_wMpzh0yWhGcVJhundmL=QL1X_KqG_Jfw@mail.gmail.com>
	<[email protected]>
	<CAEzWdqdDTPxxzQYJfr_RdJTtLx-kNnc__z8f9nB25wVQuKzapg@mail.gmail.com>
	<CAKAnmmKMzXaUeVg-WLVReCOD-=+8GUq8=Uc7a0jfU6DgzPZ_Yg@mail.gmail.com>
	<CAEzWdqc4jA3D4RX4u3fgHYc37W5h2q=3ucef0yT3ppeB-9MBTg@mail.gmail.com>
	<CAEzWdqe9U7zXSuDPpT8O_E=GykZx=3ttVEwU5wMN0AnFARSZxg@mail.gmail.com>

>
> Additionally in the plan which mysql makes and showing the highest
> response time, is it suffering because of differences of the speed of the
> underlying IO/storage or is it just because of the optimization features
> which are available in postgres and not there in mysql ? Trying to
> understand if it can be identified from the execution plan itself.
>

I think trying to compare postgres and mysql plans against each other is
not a very useful endeavor. There are fundamental design decisions between
the two. Focus on making your Postgres query the best it can be, full stop.
Optimize your queries, make sure the database is analyzed, and tweak some
configs as needed.

Also, you cannot accidentally forget a join condition.


Yes, this is the primary reason. Cartesian joins hurt.

Again , not able to clearly understand the third point you said below. Can
> you please clarify a bit more. Do you mean we should write it as exists
> /not exists rather IN and NOT IN and that will improve the performance?


It gives Postgres more options on how to do things, so yes, it can be
better.

Cheers,
Greg


view thread (9+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Query performance issue
  In-Reply-To: <CAKAnmmL_=6PjxSJD105oSSfEPiCyk_KQp5ZCPz2AsdunznOXeA@mail.gmail.com>

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

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