Hi,
How, according to EXPLAIN ANALYZE, the Sort node could return more rows
as output (rows=767662), than it had for input from its child node
(rows=135627)?
-> Merge Join .... (actual time=1977.388..333626.072 rows=725757 loops=1)
-> Index Scan using .... (actual time=0.013..312144.441
rows=49176765 loops=1)
-> Sort .... (actual time=1977.363..2274.092 rows=767662 loops=1)
-> Hash Left Join .... (actual time=97.123..1887.956
rows=135627 loops=1)
(full plan attached, PostgreSQL 9.3)
Regards,
Vitaliy