GroupAggregate (cost=138944.80..162723.16 rows=731642 width=28) -> Sort (cost=138944.80..140773.90 rows=731642 width=28) Sort Key: t2.time2_id, f.region_id, f.dealer_id, f.product_id, f.contract_id, f.promotion_id -> Nested Loop (cost=223.05..20660.02 rows=731642 width=28) -> Merge Join (cost=223.05..263.18 rows=1 width=4) Merge Cond: (("outer".bus_year = "inner".bus_year) AND ("outer".bus_semi = "inner".bus_semi) AND ("outer".bus_quarter = "inner".bus_quarter) AND ("outer".bus_month = "inner".bus_month)) -> Sort (cost=118.22..122.47 rows=1700 width=14) Sort Key: t2.bus_year, t2.bus_semi, t2.bus_quarter, t2.bus_month -> Seq Scan on dim_time2 t2 (cost=0.00..27.00 rows=1700 width=14) -> Sort (cost=104.83..108.61 rows=1510 width=10) Sort Key: t1.bus_year, t1.bus_semi, t1.bus_quarter, t1.bus_month -> Seq Scan on dim_time t1 (cost=0.00..25.10 rows=1510 width=10) -> Seq Scan on fact_sales f (cost=0.00..13080.42 rows=731642 width=24) (13 rows)