Maxim Boguk <mboguk(at)masterhost(dot)ru> writes:
> Looks like when indexed search over NULL's added, planner wasn't learned right way use such index on "where something is NULL order by ... limit ..."
> queries.
There's nothing wrong with the plan; you've just got too many NULLs to
make it worth using the index for that.
regards, tom lane