chang chao <chang-chao@hotmail.com> writes:
> The actual rows(rows=9950) part in the following line contained in the above query plan seems strange.
> " -> Sort (cost=10.64..11.14 rows=200 width=520) (actual time=0.045..0.561 rows=9950 loops=1)"
> Shouldn't it be 200?
No, that's probably correct, seeing that this node is the righthand child
of a mergejoin. The discrepancy is from extra fetches due to the same row
being re-fetched multiple times thanks to mark/restore rescanning. What
explain is reporting is the number of rows pulled from the node, not the
number of unique rows it processed.
regards, tom lane