Re: Explain output: wrong row count? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Explain output: wrong row count?
Date
Msg-id 675.1101404818@sss.pgh.pa.us
Whole thread Raw
In response to Explain output: wrong row count?  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-hackers
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> I have this EXPLAIN ANALYZE output:
> ...
>    ->  Hash  (cost=13.99..13.99 rows=499 width=89) (actual time=5.947..5.947 rows=0 loops=1)
>          ->  Seq Scan on ciudad  (cost=0.00..13.99 rows=499 width=89) (actual time=0.018..3.909 rows=499 loops=1)

> Note that the Hash step has an estimated row count of 499 (which is a
> good estimate), but the actual row count is 0, which is way off.

The "actual rows" count on a Hash node is always 0, because we don't
retrieve rows from it in the normal way (ie via ExecProcNode).  The
actual row count from the child plan node (here, the 499 for the
seqscan) tells you how many rows got loaded into the hashtable.

I've occasionally thought about putting in some kind of kluge to set the
"actual rows" count to the hash table size, just because it looks funny
to have zero there.  But it hasn't got to the top of the to-do list ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Solaris 8 regression test failure with 8.0.0beta5
Next
From: Tom Lane
Date:
Subject: Re: Solaris 8 regression test failure with 8.0.0beta5