Re: Understanding bad estimate (related to FKs?) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Understanding bad estimate (related to FKs?)
Date
Msg-id 741231.1604347692@sss.pgh.pa.us
Whole thread Raw
In response to Re: Understanding bad estimate (related to FKs?)  (Philip Semanchuk <philip@americanefficient.com>)
Responses Re: Understanding bad estimate (related to FKs?)  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-performance
Philip Semanchuk <philip@americanefficient.com> writes:
> The query I asked about in the original post of this thread has 13 relations in it. IIUC, that's 13! or > 6 billion
possibleplans. How did the planner pick one plan out of 6 billion? I'm curious, both for practical purposes (I want my
queryto run well) and also because it's fascinating. 

The twenty-thousand-foot overview is

https://www.postgresql.org/docs/devel/planner-optimizer.html

and then ten-thousand-foot level is the planner README file,

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob_plain;f=src/backend/optimizer/README;hb=HEAD

and then you pretty much gotta start reading code.  You could also dig
into various planner expository talks that people have given at PG
conferences.  I don't have links at hand, but there have been several.

            regards, tom lane



pgsql-performance by date:

Previous
From: Philip Semanchuk
Date:
Subject: Re: Understanding bad estimate (related to FKs?)
Next
From: Guillaume Lelarge
Date:
Subject: Re: Understanding bad estimate (related to FKs?)