> The optimizer is perfectly happy with approximate tuple counts, so it
> makes do with stats recorded at the last VACUUM.
>
> This has been discussed quite recently on pg-hackers; see the archives
> for more info.
Yes, the problem is not the optimizer. The problem is the select count(*).
A lot of DB's (like Informix) have a shortcut on this, and even though they
have it,
they don't use it for the optimizer.
If our btrees have an accurate count (deleted rows ?), scanning the smallest
index
would also be alot faster.
Andreas