Alessandro Baretta <a.baretta@xxxxxxxxxxxxxxx> writes: > I have no clue as to how or why the statistics were wrong > yesterday--as I vacuum-analyzed continuously out of lack of any better > idea--and I was stupid enough to re-timestamp everything before > selecting from pg_stats. Too bad. I would be interested to find out how, if the stats were up-to-date, the thing was still getting the row estimate so wrong. If you manage to get the database back into its prior state please do send along the pg_stats info. regards, tom lane