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:38:21 -0500
Message-ID: <2748481.1703713101@sss.pgh.pa.us> (raw)
In-Reply-To: <BL0PR02MB456100A86F1081148D6DBE82A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>
References: <BL0PR02MB45615E13EF7F8CE1AF3FFB04A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>
	<BL0PR02MB45616822F8516830F5900909A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>
	<2746245.1703712111@sss.pgh.pa.us>
	<BL0PR02MB456100A86F1081148D6DBE82A19FA@BL0PR02MB4561.namprd02.prod.outlook.com>

jian xu <jamesxu@outlook.com> writes:
> Thanks Tom, except for setting parameters, is there any other ways to show debug information about plan generating? For example, can pg show all the candidate plans it searched, and the cost of each candidate plan?

No, because rejected alternatives are not carried through to the point
of having a displayable plan.  (Trying to do so would be enormously
expensive.)  People have experimented with adding trace facilities
that would show some details about rejected plan alternatives, but
none of that has led to a facility that I'd care to use.

			regards, tom lane





view thread (5+ messages)

Message-ID: <2748481.1703713101@sss.pgh.pa.us>
Permalink:  ../2748481.1703713101@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2748481.1703713101@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: <2748481.1703713101@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