Sort (cost=2144.43..2148.83 rows=1762 width=348) (actual time=993.292..993.329 rows=18 loops=1) Sort Key: public.programme.chan_id -> Hash Left Join (cost=1261.53..2049.43 rows=1762 width=348) (actual time=991.208..992.905 rows=18 loops=1) Hash Cond: ("outer".prog_next = "inner".prog_id) -> Hash Join (cost=250.81..596.33 rows=1762 width=271) (actual time=24.193..176.767 rows=18 loops=1) Hash Cond: ("outer".chan_id = "inner".chan_id) -> Merge Join (cost=249.56..568.64 rows=1762 width=77) (actual time=23.710..171.313 rows=18 loops=1) Merge Cond: ("outer".title_id = "inner".title_id) -> Index Scan using "$3" on title (cost=0.00..266.13 rows=10683 width=27) (actual time=0.047..81.038 rows=10650 loops=1) -> Sort (cost=249.56..253.96 rows=1762 width=54) (actual time=23.254..23.298 rows=18 loops=1) Sort Key: public.programme.title_id -> Index Scan using prog_stop_idx on programme (cost=0.00..154.56 rows=1762 width=54) (actual time=0.105..23.107 rows=18 loops=1) Index Cond: (prog_stop > '2004-01-14 19:52:46'::timestamp without time zone) Filter: (prog_start <= '2004-01-14 19:52:46'::timestamp without time zone) -> Hash (cost=1.20..1.20 rows=20 width=198) (actual time=0.354..0.354 rows=0 loops=1) -> Seq Scan on channel (cost=0.00..1.20 rows=20 width=198) (actual time=0.062..0.252 rows=20 loops=1) -> Hash (cost=887.51..887.51 rows=8085 width=77) (actual time=782.379..782.379 rows=0 loops=1) -> Hash Join (cost=285.54..887.51 rows=8085 width=77) (actual time=212.806..703.331 rows=8085 loops=1) Hash Cond: ("outer".title_id = "inner".title_id) -> Seq Scan on programme (cost=0.00..173.85 rows=8085 width=54) (actual time=0.023..45.351 rows=8085 loops=1) -> Hash (cost=190.83..190.83 rows=10683 width=27) (actual time=212.350..212.350 rows=0 loops=1) -> Seq Scan on title (cost=0.00..190.83 rows=10683 width=27) (actual time=0.061..131.381 rows=10767 loops=1) Total runtime: 995.482 ms