Re: how to troubleshoot a wrong query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jian xu <jamesxu(at)outlook(dot)com>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: how to troubleshoot a wrong query plan
Date: 2023-12-27 21:38:21
Message-ID: 2748481.1703713101@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

jian xu <jamesxu(at)outlook(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Wilson, Maria Louise (LARC-E301)[RSES] 2023-12-27 21:40:41 Need help with slow query - postgres 12 on linux RHEL 8
Previous Message jian xu 2023-12-27 21:29:39 Re: how to troubleshoot a wrong query plan