> Are these the addtional values you wanted to see?
Yes, but I just noticed something else strange:
> -> Index Scan using foo2_pkey on foo2 > (cost=0.00..10387.79 rows=352072 width=4) > (actual time=0.26..174.32 rows=38432 loops=1)
The actual rows read from this indexscan seem to be many fewer than the number of rows in the table. What are the ranges of the id values in tables foo and bar? I'm wondering if the merge could have stopped far short of the end of the foo table; if so, *that* is the effect that we are failing to model accurately.