you're joining on more than one key. That always hurts performance.
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных