pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian xu <jamesxu@outlook.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: how to troubleshoot a wrong query plan
Date: Wed, 27 Dec 2023 16:21:51 -0500
Message-ID: <2746245.1703712111@sss.pgh.pa.us> (raw)
In-Reply-To: <BL0PR02MB45616822F8516830F5900909A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>
References: <BL0PR02MB45615E13EF7F8CE1AF3FFB04A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>
	<BL0PR02MB45616822F8516830F5900909A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>

jian xu <jamesxu@outlook.com> writes:
> Sorry, we figured out that the PostgreSQL.conf has the nestloop disabledÂ….thatÂ’s why It picked merge join by default
> But it might be still very helpful if there is a way to show how the plan is generated , or some debug information about the plan generating, for example in this case, if we can debug the plan and see nestloop is disable, it will be easy for us figure out the problem.

In supported releases of PG, there's the EXPLAIN (SETTINGS) option, which
will print the values of any non-default settings that affect planning.
Of course, you have to remember to use that, but it does respond to
your point.

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <2746245.1703712111@sss.pgh.pa.us>
Permalink:  ../2746245.1703712111@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2746245.1703712111@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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jamesxu@outlook.com, pgsql-admin@lists.postgresql.org
  Subject: Re: how to troubleshoot a wrong query plan
  In-Reply-To: <2746245.1703712111@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