Craig Ringer <cr...@2ndquadrant.com> writes: > On 9 September 2016 at 01:40, Roger Pack <rogerdpa...@gmail.com> wrote: >> Today's explain tells us what loops and scans were used, and relative >> costs, etc. It doesn't seem to tell *why* the planner elected to use >> what it did.
> One thing that's been discussed here is to have a way to see which > potential plans are rejected and compare their costs. > This isn't simple because there are often *lots* of variants. You > don't just want to see the "top 10" candidate plans, because they're > probably a bunch of small variants on the same plan; the ones you'll > be interested in will probably be very different plans with very bad > relative estimates. The other big problem here is that the planner tries *very* hard to reject losing paths early; so it does not even form an explainable plan for a large fraction of the search space. (And if it did, you'd be dead before you got your EXPLAIN result back.) People have experimented with making the planner log every candidate path before the path enters the comparison tournament (and, typically, doesn't survive the first round). But I've never seen any version of that that I thought would be intelligible to non-experts. It's exceedingly verbose and it certainly doesn't look anything like what we know as EXPLAIN output. regards, tom lane -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers