Albe Laurenz пишет:
> Vlad Arkhipov wrote:
>
>> I found strange issue in very simple query.
>>
>
> You forgot to mention what your problem is.
>
> Yours,
> Laurenz Albe
>
It was written below in my first post:
"These queries are part of big query and optimizer put them on the leaf
of query tree, so rows miscount causes a real problem. "
actual rows count for the first query is 294, estimate - 11; for the
second -- 283 and 0. Postgres tries to use nested loops when it should
use merge/hash join and vice versa.