Re: How does the planner determine plan_rows ? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: How does the planner determine plan_rows ?
Date
Msg-id 7958.1547179311@sss.pgh.pa.us
Whole thread Raw
In response to How does the planner determine plan_rows ?  (Donald Dong <xdong@csumb.edu>)
Responses Re: How does the planner determine plan_rows ?  (Donald Dong <xdong@csumb.edu>)
List pgsql-hackers
Donald Dong <xdong@csumb.edu> writes:
> I created some empty tables and run ` EXPLAIN ANALYZE` on `SELECT * `. I found
> the results have different row numbers, but the tables are all empty.

This isn't a terribly interesting case, since you've neither loaded
any data nor vacuumed/analyzed the table, but ...

> I found this behavior unexpected. I'm still trying to find out how/where the planner
> determines the plan_rows.

... estimate_rel_size() in plancat.c is where to look to find out
about the planner's default estimates when it's lacking hard data.

            regards, tom lane


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: speeding up planning with partitions
Next
From: Chapman Flack
Date:
Subject: Re: Ryu floating point output patch