create table jointable ( id1 integer not null, id2 date not null, id3 integer not null, id4 time not null, id5 integer not null ); and then perform a join against this table.
as you increase the number of rows in jointable, the planner switches to a sort + merge. in this case jointable has roughly 2 million rows.
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных