Re: PROC_IN_ANALYZE stillborn 13 years ago - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PROC_IN_ANALYZE stillborn 13 years ago
Date
Msg-id 2793035.1596825701@sss.pgh.pa.us
Whole thread Raw
In response to Re: PROC_IN_ANALYZE stillborn 13 years ago  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Thinking about it more, there are really two ways to think about an
> estimated row count.

> On the one hand, if you think of the row count estimate as the number
> of rows that are going to pop out of a node, then it's always right to
> think of a unique index as limiting the number of occurrences of a
> given value to 1. But, if you think of the row count estimate as a way
> of estimating the amount of work that the node has to do to produce
> that output, then it isn't.

The planner intends its row counts to be interpreted in the first way.
We do have a rather indirect way of accounting for the cost of scanning
dead tuples and such, which is that we scale scanning costs according
to the measured physical size of the relation.  That works better for
I/O costs than it does for CPU costs, but it's not completely useless
for the latter.  In any case, we'd certainly not want to increase the
scan's row count estimate for that, because that would falsely inflate
our estimate of how much work upper plan levels have to do.  Whatever
happens at the scan level, the upper levels aren't going to see those
dead tuples.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Parallel worker hangs while handling errors.
Next
From: David Zhang
Date:
Subject: Re: Add LWLock blocker(s) information