explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KdZU : Optimization for: Optimization for: plan #WB7w; plan #HwrQ

Settings

Optimization path:

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

Unique (cost=7,644,337.10..7,644,880.79 rows=10,356 width=518) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=7,644,337.10..7,644,362.99 rows=10,356 width=518) (actual rows= loops=)

  • Sort Key: ref_people.id_filiale, top_challenge_list.template_challenge, top_challenge_list.id_challenge, ref_people.id_int, ref_people.id_filiale, ref_people.id_ext, ((((COALESCE(ref_people.firstname, ''::character varying))::text || ' '::text) || (COALESCE(ref_people.name, ''::character varying))::text)), ((top_challenge_list.date_deb_challenge)::date), ((top_challenge_list.date_fin_challenge)::date), top_challenge_list.id_status, top_challenge_list.lib_status, ((top_challenge_list.date_crea)::date), filleuls.id_int, filleuls.id_filiale, filleuls.id_ext, ((((COALESCE(filleuls.firstname, ''::character varying))::text || ' '::text) || (COALESCE(filleuls.name, ''::character varying))::text)), filleuls.id_qualification, filleuls.code_qualification, ((COALESCE(((COALESCE((SubPlan 1), '0'::double precision))::numeric(10,2) + (COALESCE((SubPlan 2), '0'::double precision))::numeric(10,2)), '0'::numeric))::numeric(10,2)), (0)
3. 0.000 0.000 ↓ 0.0

Append (cost=6.00..7,641,238.45 rows=10,356 width=518) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6.00..48,074.61 rows=62 width=172) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.57..2,419.22 rows=65 width=85) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.15..2,355.40 rows=5 width=85) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on top_challenge_list (cost=4.73..29.47 rows=58 width=57) (actual rows= loops=)

  • Recheck Cond: ((template_challenge)::text = 'top_turnover'::text)
  • Filter: is_active
8. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on top_challenge_list_xperf1 (cost=0.00..4.71 rows=59 width=0) (actual rows= loops=)

  • Index Cond: ((template_challenge)::text = 'top_turnover'::text)
9. 0.000 0.000 ↓ 0.0

Index Scan using ref_people_xperf1 on ref_people (cost=0.42..40.09 rows=1 width=28) (actual rows= loops=)

  • Index Cond: (id_int = top_challenge_list.id_int_manager)
  • Filter: (is_active AND (id_statut <> 2) AND (COALESCE(id_qualification, 1) >= 1) AND (id_type = 5))
10. 0.000 0.000 ↓ 0.0

Index Scan using ref_genealogy_xperf5 on ref_genealogy (cost=0.42..12.56 rows=20 width=8) (actual rows= loops=)

  • Index Cond: (id_int = ref_people.id_int)
  • Filter: is_active
11. 0.000 0.000 ↓ 0.0

Index Scan using ref_people_xperf1 on ref_people filleuls (cost=0.42..0.82 rows=1 width=47) (actual rows= loops=)

  • Index Cond: (id_int = ref_genealogy.id_int_level)
  • Filter: (is_active AND (id_type = ANY ('{5,14}'::integer[])))
12.          

SubPlan (forNested Loop)

13. 0.000 0.000 ↓ 0.0

Aggregate (cost=361.46..361.47 rows=1 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using ref_transaction_xperf4 on ref_transaction (cost=0.42..361.46 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_int_agent_out = filleuls.id_int)
  • Filter: (is_active AND (date_acte IS NOT NULL) AND (date_acte >= top_challenge_list.date_deb_challenge) AND (date_acte <= top_challenge_list.date_fin_challenge) AND (id_type_transaction = 1))
15. 0.000 0.000 ↓ 0.0

Aggregate (cost=373.99..374.00 rows=1 width=8) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan using ref_transaction_xperf3 on ref_transaction ref_transaction_1 (cost=0.42..373.99 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_int_agent_in = filleuls.id_int)
  • Filter: (is_active AND (date_acte IS NOT NULL) AND (date_acte >= top_challenge_list.date_deb_challenge) AND (date_acte <= top_challenge_list.date_fin_challenge) AND (id_type_transaction = 1))
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.27..7,593,008.50 rows=10,294 width=172) (actual rows= loops=)

  • Join Filter: (ref_people_1.id_filiale = top_challenge_list_1.id_filiale)
18. 0.000 0.000 ↓ 0.0

Index Scan using top_challenge_xperf4 on top_challenge_list top_challenge_list_1 (cost=0.27..52.04 rows=3 width=57) (actual rows= loops=)

  • Filter: ((id_int_manager IS NULL) AND is_active AND ((template_challenge)::text = 'top_turnover'::text))
19. 0.000 0.000 ↓ 0.0

Materialize (cost=1,000.00..26,301.48 rows=3,611 width=47) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..26,283.43 rows=3,611 width=47) (actual rows= loops=)

  • Workers Planned: 2
21. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on ref_people ref_people_1 (cost=0.00..24,922.33 rows=1,505 width=47) (actual rows= loops=)

  • Filter: (is_active AND (id_statut <> 2) AND (COALESCE(id_qualification, 1) >= 1) AND (id_type = 5))
22.          

SubPlan (forNested Loop)

23. 0.000 0.000 ↓ 0.0

Aggregate (cost=361.23..361.24 rows=1 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Index Scan using ref_transaction_xperf4 on ref_transaction ref_transaction_2 (cost=0.42..361.23 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_int_agent_out = ref_people_1.id_int)
  • Filter: (is_active AND (date_acte IS NOT NULL) AND (date_acte >= top_challenge_list_1.date_deb_challenge) AND (date_acte <= top_challenge_list_1.date_fin_challenge))
25. 0.000 0.000 ↓ 0.0

Aggregate (cost=373.75..373.77 rows=1 width=8) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using ref_transaction_xperf3 on ref_transaction ref_transaction_3 (cost=0.42..373.75 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_int_agent_in = ref_people_1.id_int)
  • Filter: (is_active AND (date_acte IS NOT NULL) AND (date_acte >= top_challenge_list_1.date_deb_challenge) AND (date_acte <= top_challenge_list_1.date_fin_challenge))