While you're waiting, you might think about recasting the query to avoid the OR. Perhaps you could do a UNION of two scans of the transactions table?
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных