Re: Accounting for between table correlation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Stoddard <alexander(dot)stoddard(at)gmail(dot)com>
Cc: Michael Lewis <mlewis(at)entrata(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Thomas Kellerer <shammat(at)gmx(dot)net>
Subject: Re: Accounting for between table correlation
Date: 2021-01-19 22:15:47
Message-ID: 551426.1611094547@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alexander Stoddard <alexander(dot)stoddard(at)gmail(dot)com> writes:
> Thank you for this. I can get different plans by changing the different
> parameters, but if the output of EXPLAIN VERBOSE tells me geqo planning
> specifically is being used I'm not seeing it. Is there a way to see in the
> explain plan if geqo was used?

It's not reported directly, but you can assume that it was used if the
number of relations in the query (the number of table scans in the plan,
more or less) is >= geqo_threshold. Or if you're unsure, check whether
turning the "geqo" boolean on/off changes the plan at all. In theory you
might get exactly the same plan from the regular and geqo planners, but
for reasonable values of geqo_threshold that's pretty unlikely, I think.

(Another way to be sure might be to notice whether turning geqo on/off
changes the planning time significantly. geqo off should be a great deal
more expensive for large plans.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2021-01-20 02:56:03 Re: Error messages on duplicate schema names
Previous Message Alexander Stoddard 2021-01-19 22:03:53 Re: Accounting for between table correlation