explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ScqI : Optimization for: plan #YuwT

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

XN Hash Join DS_BCAST_INNER (cost=2,543,812,126,772.93..2,543,817,246,921.68 rows=1 width=280) (actual rows= loops=)

  • Hash Cond: (("outer".ship_date = "inner".cal_day_date) AND ("outer".marketplace_id = ("inner".marketplace_id)::numeric))
2. 0.000 0.000 ↓ 0.0

XN Subquery Scan units (cost=1,398,451,749,792.64..1,398,451,749,842.22 rows=2,833 width=63) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

XN HashAggregate (cost=1,398,451,749,792.64..1,398,451,749,813.89 rows=2,833 width=23) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

XN Hash Join DS_DIST_BOTH (cost=487,874.56..1,398,451,748,890.38 rows=120,302 width=23) (actual rows= loops=)

  • Outer Dist Key: fsun.ordering_customer_id
  • Inner Dist Key: dim_ab_customers.amazon_account_skey
  • Hash Cond: (("outer".ordering_customer_id = "inner".amazon_account_skey) AND ("outer".marketplace_id = ("inner".marketplace_id)::numeric))
  • Join Filter: ((trunc(("outer".ship_day)::timestamp without time zone) <= trunc("inner".effective_end_date)) AND (trunc(("outer".ship_day)::timestamp without time zone) >= trunc("inner".effective_start_date)))
5. 0.000 0.000 ↓ 0.0

XN Seq Scan on d_ab_unified_cust_ship_items fsun (cost=0.00..10,023,737.92 rows=190,928,342 width=36) (actual rows= loops=)

  • Filter: ('2019-06-01'::date <= trunc((ship_day)::timestamp without time zone))
6. 0.000 0.000 ↓ 0.0

XN Hash (cost=425,522.97..425,522.97 rows=12,470,318 width=33) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

XN Seq Scan on dim_ab_customers (cost=0.00..425,522.97 rows=12,470,318 width=33) (actual rows= loops=)

  • Filter: (((is_active_now)::text = 'Y'::text) AND ((is_business_account_active)::text = 'Y'::text) AND (is_internal_business_account = 0))
8. 0.000 0.000 ↓ 0.0

XN Hash (cost=1,145,360,376,980.28..1,145,360,376,980.28 rows=2 width=248) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

XN Subquery Scan contacts_agg (cost=1,145,360,376,980.23..1,145,360,376,980.28 rows=2 width=248) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

XN HashAggregate (cost=1,145,360,376,980.23..1,145,360,376,980.26 rows=2 width=192) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

XN Subquery Scan contacts_raw (cost=1,145,360,376,949.13..1,145,360,376,980.15 rows=3 width=192) (actual rows= loops=)

  • Filter: (rn = 1)
12. 0.000 0.000 ↓ 0.0

XN Window (cost=1,145,360,376,949.13..1,145,360,376,973.10 rows=564 width=162) (actual rows= loops=)

  • Partition: dim_ab_customers.amazon_account_skey, dim_ab_customers.marketplace_id
  • Order: dim_ab_customers.business_registration_date
13. 0.000 0.000 ↓ 0.0

XN Sort (cost=1,145,360,376,949.13..1,145,360,376,950.54 rows=564 width=162) (actual rows= loops=)

  • Sort Key: dim_ab_customers.amazon_account_skey, dim_ab_customers.marketplace_id, dim_ab_customers.business_registration_date
14. 0.000 0.000 ↓ 0.0

XN Network (cost=112,774,353,717.93..145,360,376,923.35 rows=564 width=162) (actual rows= loops=)

  • Distribute
15. 0.000 0.000 ↓ 0.0

XN Hash Join DS_BCAST_INNER (cost=112,774,353,717.93..145,360,376,923.35 rows=564 width=162) (actual rows= loops=)

  • Hash Cond: (("outer".amazon_account_skey = ("inner".customer_id)::numeric) AND ("outer".marketplace_id = "inner".marketplace_skey))
  • Join Filter: (("inner".comm_creation_day_lcl_skey <= (to_char("outer".effective_end_date, 'YYYYMMDD'::text))::integer) AND (trunc("outer".business_registration_date) <= trunc("inner".comm_creation_day_lcl)) AND ("inner".comm_creation_day_lcl_skey >= (to_char("outer".effective_start_date, 'YYYYMMDD'::text))::integer))
16. 0.000 0.000 ↓ 0.0

XN Seq Scan on dim_ab_customers (cost=0.00..425,522.97 rows=12,470,318 width=41) (actual rows= loops=)

  • Filter: (((is_active_now)::text = 'Y'::text) AND ((is_business_account_active)::text = 'Y'::text) AND (is_internal_business_account = 0))
17. 0.000 0.000 ↓ 0.0

XN Hash (cost=112,774,353,620.80..112,774,353,620.80 rows=19,426 width=153) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

XN Hash Join DS_BCAST_INNER (cost=36,802,803.17..112,774,353,620.80 rows=19,426 width=153) (actual rows= loops=)

  • Hash Cond: ("outer".comm_id = "inner".comm_id)
19. 0.000 0.000 ↓ 0.0

XN Seq Scan on fact_hmd_na hmd (cost=0.00..17,794,033.92 rows=176,732,023 width=65) (actual rows= loops=)

  • Filter: (('2019-06-01'::date <= trunc(comm_creation_day_lcl)) AND (customer_id > 1) AND ((owner_agent_login)::text <> 'drone'::text) AND ((owner_agent_login)::text <> 'cs-arf'::text))
20. 0.000 0.000 ↓ 0.0

XN Hash (cost=36,802,585.86..36,802,585.86 rows=86,925 width=104) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

XN Subquery Scan ct (cost=36,801,064.67..36,802,585.86 rows=86,925 width=104) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

XN HashAggregate (cost=36,801,064.67..36,801,716.61 rows=86,925 width=32) (actual rows= loops=)