pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Related To Query Optimization
Date: Thu, 11 May 2023 17:11:07 +0200
Message-ID: <3c797d81-49e6-e8a2-b1b0-b63cb25901e5@jakobs.com> (raw)
In-Reply-To: <CAKDb7aG9od8XB=3YCDe61JPTqjC0BD71usWN-sr5DAMJZPhH1w@mail.gmail.com>
References: <CAKDb7aG9od8XB=3YCDe61JPTqjC0BD71usWN-sr5DAMJZPhH1w@mail.gmail.com>

Am 11.05.23 um 16:50 schrieb ROHIT SACHDEVA:
>
> Hi Team,
>
>  I am facing an issue where one of the queries is taking time in 
> production.
> When I put that query in explain, I found many nested loop conditions 
> were being used, so just for testing, I disabled the enable_nestloop 
> flag for a session, and now the query is running fast.
> I also ran an analyze on every table of that query and also indexing 
> is there on required columns.
>
>  Tell me where i am wrong and what can be done, as i don't want to 
> disable it because, according to me, it's not a good practise.
>
>
> --
> Have a Good day !!!
>
> Regards
> Rohit Sachdeva

I think it's totally impossible to tell without knowing more details.

Please post the CREATE TABLE commands, the number of rows in the tables, 
the SELECT command and the output of EXPLAIN.

Kind Regards,

Holger


> -- 

Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  [application/pgp-signature] OpenPGP_signature (202B, ../3c797d81-49e6-e8a2-b1b0-b63cb25901e5@jakobs.com/3-OpenPGP_signature)
  download

view thread (2+ messages)

Message-ID: <3c797d81-49e6-e8a2-b1b0-b63cb25901e5@jakobs.com>
Permalink:  ../3c797d81-49e6-e8a2-b1b0-b63cb25901e5@jakobs.com/
Also on:    postgresql.org/message-id/3c797d81-49e6-e8a2-b1b0-b63cb25901e5@jakobs.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Related To Query Optimization
  In-Reply-To: <3c797d81-49e6-e8a2-b1b0-b63cb25901e5@jakobs.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