Just a general note re the subject, I've also had troubles with postgres being unable to optimize a query with OR. The work-around, although a bit messy, was to use a UNION-query instead.
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных