QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- HashAggregate (cost=2552680.87..2553501.76 rows=54726 width=135) -> Hash Join (cost=1008.35..2550628.65 rows=54726 width=135) Hash Cond: ("outer".s_key = "inner"."key") -> Hash Join (cost=803.07..2548507.96 rows=54726 width=108) Hash Cond: ("outer".cp_key = "inner"."key") -> Hash Join (cost=687.96..2547161.51 rows=54726 width=82) Hash Cond: ("outer".ch_key = "inner"."key") -> Hash Join (cost=601.21..2545843.43 rows=54726 width=60) Hash Cond: ("outer".cr_key = "inner"."key") -> Hash Join (cost=265.72..2544002.98 rows=54726 width=62) Hash Cond: ("outer".go_key = "inner"."key") -> Hash Join (cost=23.12..2541844.97 rows=54726 width=62) Hash Cond: ("outer".adv_key = "inner"."key") -> Nested Loop (cost=0.00..2541000.08 rows=54901 width=48) -> Nested Loop (cost=0.00..4.14 rows=2 width=16) -> Seq Scan on r_n (cost=0.00..1.06 rows=1 width=4) Filter: (id = 607) -> Index Scan using r_d_sqldt_idx on r_da (cost=0.00..3.05 rows=2 width=12) Index Cond: ((sqldate >= '2008-01-01 00:00:00'::timestamp without time zone) AND (sqldate <= '2008-01-31 00:00:00'::timestamp without time zone)) -> Index Scan using r_m_nw_date_idx on r_m (cost=0.00..1259386.12 rows=740790 width=48) Index Cond: ((r_m.nw_key = "outer"."key") AND (r_m.date_key = "outer"."key")) -> Hash (cost=20.77..20.77 rows=939 width=22) -> Seq Scan on r_adv (cost=0.00..20.77 rows=939 width=22) Filter: ((name)::text <> 'SYSTEM'::text) -> Hash (cost=218.28..218.28 rows=9728 width=8) -> Seq Scan on rg (cost=0.00..218.28 rows=9728 width=8) -> Hash (cost=302.39..302.39 rows=13239 width=6) -> Seq Scan on rc (cost=0.00..302.39 rows=13239 width=6) -> Hash (cost=77.20..77.20 rows=3820 width=30) -> Seq Scan on r_c (cost=0.00..77.20 rows=3820 width=30) -> Hash (cost=104.89..104.89 rows=4089 width=34) -> Seq Scan on r_cm (cost=0.00..104.89 rows=4089 width=34) -> Hash (cost=181.42..181.42 rows=9542 width=35) -> Seq Scan on r_s (cost=0.00..181.42 rows=9542 width=35) (34 rows)