explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vsmI : Optimization for: plan #OQ43

Settings

Optimization path:

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

Subquery Scan on a (cost=1,832,088.74..9,313,683.95 rows=39,490,416 width=89) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Finalize GroupAggregate (cost=1,832,088.74..8,523,875.63 rows=39,490,416 width=81) (actual rows= loops=)

  • Group Key: (time_bucket('1 day'::interval, timezone('Europe/Paris'::text, profilelibrary_mat.start_datetime_utc))), fu_contract_mat.sub_profile, fu_contract_mat.supply_duration, fu_contract_mat.subscribed_power, fu_contract_mat.entity, fu_contract_mat.offer, fu_contract_mat.sales_campaign
3. 0.000 0.000 ↓ 0.0

Gather Merge (cost=1,832,088.74..7,042,985.03 rows=39,490,416 width=81) (actual rows= loops=)

  • Workers Planned: 6
4. 0.000 0.000 ↓ 0.0

Partial GroupAggregate (cost=1,831,088.64..2,242,447.14 rows=6,581,736 width=81) (actual rows= loops=)

  • Group Key: (time_bucket('1 day'::interval, timezone('Europe/Paris'::text, profilelibrary_mat.start_datetime_utc))), fu_contract_mat.sub_profile, fu_contract_mat.supply_duration, fu_contract_mat.subscribed_power, fu_contract_mat.entity, fu_contract_mat.offer, fu_contract_mat.sales_campaign
5. 0.000 0.000 ↓ 0.0

Sort (cost=1,831,088.64..1,847,542.98 rows=6,581,736 width=105) (actual rows= loops=)

  • Sort Key: (time_bucket('1 day'::interval, timezone('Europe/Paris'::text, profilelibrary_mat.start_datetime_utc))), fu_contract_mat.sub_profile, fu_contract_mat.supply_duration, fu_contract_mat.subscribed_power, fu_contract_mat.entity, fu_contract_mat.offer, fu_contract_mat.sales_campaign
6. 0.000 0.000 ↓ 0.0

Merge Join (cost=487,029.33..637,707.03 rows=6,581,736 width=105) (actual rows= loops=)

  • Merge Cond: ((profilelibrary_mat.month = fu_contract_mat.month_delivery) AND (profilelibrary_mat.sub_profile = (fu_contract_mat.sub_profile)::text))
7. 0.000 0.000 ↓ 0.0

Sort (cost=453,839.40..457,632.91 rows=1,517,405 width=42) (actual rows= loops=)

  • Sort Key: profilelibrary_mat.month, profilelibrary_mat.sub_profile
8. 0.000 0.000 ↓ 0.0

Parallel Index Scan using ix_profilelibrary_mat_start_datetime on profilelibrary_mat (cost=0.56..243,371.99 rows=1,517,405 width=42) (actual rows= loops=)

  • Index Cond: ((start_datetime >= '2020-04-01 00:00:00'::timestamp without time zone) AND (start_datetime <= '2023-05-31 23:30:00'::timestamp without time zone))
9. 0.000 0.000 ↓ 0.0

Materialize (cost=27,206.75..28,108.89 rows=180,428 width=89) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Sort (cost=27,206.75..27,657.82 rows=180,428 width=89) (actual rows= loops=)

  • Sort Key: fu_contract_mat.month_delivery, fu_contract_mat.sub_profile
11. 0.000 0.000 ↓ 0.0

Seq Scan on fu_contract_mat (cost=0.00..6,036.28 rows=180,428 width=89) (actual rows= loops=)