RE: [HACKERS] What does explain show ? - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject RE: [HACKERS] What does explain show ?
Date
Msg-id 001c01bece9c$a6b43300$2801007e@cadzone.tpf.co.jp
Whole thread Raw
In response to Re: [HACKERS] What does explain show ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>
> > Is the caluculation "rows of Nested loop = rows of OuterPlan * rows of
> > InnerPlan" wrong ?
>
> Careful --- rows produced and cost are quite different things.  The
> cost estimate for a nestloop is "cost of outerplan + rows of outerplan *
> cost of innerplan", but we don't necessarily expect to get as many rows
> out as the product of the row counts.  Typically, it'd be lower due to
> join selectivity.  Above you see only 3 rows out, which is not too bad
> a guess, certainly better than 2*15905 would be.
>

I see. rows of Join = rows of outerplan * rows of innerplan * "join
selectity".
and "join selectivity" is calcutated by eqjoinsel() etc.

Thanks.

Hiroshi Inoue
Inoue@tpf.co.jp



pgsql-hackers by date:

Previous
From: "Gene Sokolov"
Date:
Subject: Re: [HACKERS] Updated TODO list
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] MAX Query length