"Merge Join (cost=89373.23..97526.15 rows=525975 width=32) (actual time=276.869..523.669 rows=34749 loops=1)" " Merge Cond: ((production.company.name)::text = (production.company.name)::text)" " -> Sort (cost=44764.87..44896.49 rows=52648 width=30) (actual time=120.036..144.925 rows=15507 loops=1)" " Sort Key: production.company.name" " Sort Method: external merge Disk: 704kB" " -> Nested Loop (cost=1183.27..39376.19 rows=52648 width=30) (actual time=1.898..72.693 rows=15507 loops=1)" " -> HashAggregate (cost=1.55..1.56 rows=1 width=8) (actual time=0.020..0.022 rows=1 loops=1)" " -> Seq Scan on run (cost=0.00..1.55 rows=1 width=8) (actual time=0.010..0.012 rows=1 loops=1)" " Filter: ((name)::text = 'test'::text)" " -> Bitmap Heap Scan on company (cost=1181.72..38592.03 rows=62608 width=30) (actual time=1.873..29.251 rows=15507 loops=1)" " Recheck Cond: ((production.company.run_id)::bigint = production.run.id)" " Filter: ((production.company.status)::text = 'unprocessed'::text)" " -> Bitmap Index Scan on comp_run (cost=0.00..1166.07 rows=62608 width=0) (actual time=1.784..1.784 rows=15507 loops=1)" " Index Cond: ((production.company.run_id)::bigint = production.run.id)" " -> Materialize (cost=44608.35..45266.45 rows=52648 width=30) (actual time=156.822..252.497 rows=34749 loops=1)" " -> Sort (cost=44608.35..44739.97 rows=52648 width=30) (actual time=156.817..182.079 rows=15507 loops=1)" " Sort Key: production.company.name" " Sort Method: external merge Disk: 704kB" " -> Nested Loop (cost=1183.27..39219.67 rows=52648 width=30) (actual time=1.883..76.580 rows=15507 loops=1)" " -> HashAggregate (cost=1.55..1.56 rows=1 width=8) (actual time=0.023..0.026 rows=1 loops=1)" " -> Seq Scan on run (cost=0.00..1.55 rows=1 width=8) (actual time=0.012..0.013 rows=1 loops=1)" " Filter: ((name)::text = 'test'::text)" " -> Bitmap Heap Scan on company (cost=1181.72..38435.51 rows=62608 width=30) (actual time=1.844..27.476 rows=15507 loops=1)" " Recheck Cond: ((production.company.run_id)::bigint = production.run.id)" " -> Bitmap Index Scan on comp_run (cost=0.00..1166.07 rows=62608 width=0) (actual time=1.757..1.757 rows=15507 loops=1)" " Index Cond: ((production.company.run_id)::bigint = production.run.id)" "Total runtime: 572.370 ms"