HashAggregate row estimate = 200

Started by Christophe Pettusover 9 years ago2 messages
#1Christophe Pettus
xof@thebuild.com

Something I've noticed frequently is that HashAggregate will, especially if the children are Append with one of the nodes a non-seqscan, estimate 200 rows rather than a calculated vlaue. Where is that value coming from? The statistics target, a hardwired constant, or something else?
--
-- Christophe Pettus
xof@thebuild.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2David Rowley
david.rowley@2ndquadrant.com
In reply to: Christophe Pettus (#1)
Re: HashAggregate row estimate = 200

On 4 June 2016 at 14:10, Christophe Pettus <xof@thebuild.com> wrote:

Something I've noticed frequently is that HashAggregate will, especially if the children are Append with one of the nodes a non-seqscan, estimate 200 rows rather than a calculated vlaue. Where is that value coming from? The statistics target, a hardwired constant, or something else?

Most likely from DEFAULT_NUM_DISTINCT in selfuncs.h. This is the
fallback, when nothing else can be used.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers