explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vIHz

Settings

Optimization(s) for this plan:

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

Unique (cost=1,039,267,331,131.73..1,039,267,579,967.88 rows=16,589,077 width=48) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=1,039,267,331,131.73..1,039,267,372,604.42 rows=16,589,077 width=48) (actual rows= loops=)

  • Sort Key: hapt_call.id, regel.id, (CASE WHEN (regel_1.id IS NOT NULL) THEN 1 ELSE 0 END), (CASE WHEN (regel_2.id IS NOT NULL) THEN 1 ELSE 0 END), (COALESCE(regelhwg.id, regel_3.id, hapt_call.id))
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=62,647.85..1,039,264,394,072.48 rows=16,589,077 width=48) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=47,630.31..790,136,547,657.14 rows=16,589,077 width=48) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=44,489.95..738,040,242,148.27 rows=16,589,077 width=40) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=29,717.02..492,970,660,347.61 rows=16,589,077 width=32) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=14,944.10..247,901,078,546.94 rows=16,589,077 width=24) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using idx_hapt_call_inst_actie_aanname_actief_tap on hapt_call (cost=0.56..1,151,373.92 rows=16,589,077 width=16) (actual rows= loops=)

  • Index Cond: (tapoproep = false)
  • Filter: ((NOT tapoproep) AND (internalstate_gefiatteerd OR (NOT internalstate_actief)))
9. 0.000 0.000 ↓ 0.0

Limit (cost=14,943.54..14,943.54 rows=1 width=75) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Sort (cost=14,943.54..14,943.78 rows=95 width=75) (actual rows= loops=)

  • Sort Key: regel.id
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.15..14,943.07 rows=95 width=75) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using idx_fk_hapt_audit_call_id on hapt_audit (cost=0.57..318.82 rows=3,241 width=32) (actual rows= loops=)

  • Index Cond: (call_id = hapt_call.id)
13. 0.000 0.000 ↓ 0.0

Index Scan using idx_hapt_auditregel_audit_property on hapt_auditregel regel (cost=0.57..4.46 rows=5 width=51) (actual rows= loops=)

  • Index Cond: ((audit_id = hapt_audit.id) AND ((property)::text = 'terugRapportage'::text))
  • Filter: (((nieuwewaarde)::text !~~ '%OZIS%'::text) AND ((nieuwewaarde)::text !~~ 'WRB%'::text))
14. 0.000 0.000 ↓ 0.0

Limit (cost=14,772.92..14,772.93 rows=1 width=75) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Sort (cost=14,772.92..14,772.93 rows=1 width=75) (actual rows= loops=)

  • Sort Key: regel_1.id
16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.15..14,772.91 rows=1 width=75) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Index Scan using idx_fk_hapt_audit_call_id on hapt_audit hapt_audit_1 (cost=0.57..318.82 rows=3,241 width=32) (actual rows= loops=)

  • Index Cond: (call_id = hapt_call.id)
18. 0.000 0.000 ↓ 0.0

Index Scan using idx_hapt_auditregel_audit_property on hapt_auditregel regel_1 (cost=0.57..4.45 rows=1 width=51) (actual rows= loops=)

  • Index Cond: ((audit_id = hapt_audit_1.id) AND ((property)::text = 'terugRapportage'::text))
  • Filter: ((nieuwewaarde)::text = 'WB succesvol verstuurd. Contact is niet meer opvraagbaar via een PS.'::text)
19. 0.000 0.000 ↓ 0.0

Limit (cost=14,772.92..14,772.93 rows=1 width=75) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Sort (cost=14,772.92..14,772.93 rows=1 width=75) (actual rows= loops=)

  • Sort Key: regel_2.id
21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.15..14,772.91 rows=1 width=75) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using idx_fk_hapt_audit_call_id on hapt_audit hapt_audit_2 (cost=0.57..318.82 rows=3,241 width=32) (actual rows= loops=)

  • Index Cond: (call_id = hapt_call.id)
23. 0.000 0.000 ↓ 0.0

Index Scan using idx_hapt_auditregel_audit_property on hapt_auditregel regel_2 (cost=0.57..4.45 rows=1 width=51) (actual rows= loops=)

  • Index Cond: ((audit_id = hapt_audit_2.id) AND ((property)::text = 'terugRapportage'::text))
  • Filter: ((nieuwewaarde)::text ~~ 'WRB verstuurd met MEDVRY%'::text)
24. 0.000 0.000 ↓ 0.0

Limit (cost=3,140.36..3,140.38 rows=1 width=70) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Unique (cost=3,140.36..3,140.42 rows=4 width=70) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Sort (cost=3,140.36..3,140.37 rows=4 width=70) (actual rows= loops=)

  • Sort Key: regelhwg.id, adt.datum, adt.instantiezorgverlener_id, regelhwg.nieuwewaarde
27. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.15..3,140.32 rows=4 width=70) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using idx_fk_hapt_audit_call_id on hapt_audit adt (cost=0.57..326.92 rows=1,080 width=24) (actual rows= loops=)

  • Index Cond: (call_id = hapt_call.id)
  • Filter: (datum < hapt_call.fiatteertijd)
29. 0.000 0.000 ↓ 0.0

Index Scan using idx_hapt_auditregel_audit_property on hapt_auditregel regelhwg (cost=0.57..2.59 rows=1 width=62) (actual rows= loops=)

  • Index Cond: ((audit_id = adt.id) AND ((property)::text = 'hwg'::text))
30. 0.000 0.000 ↓ 0.0

Limit (cost=15,017.54..15,017.56 rows=1 width=71) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Unique (cost=15,017.54..15,017.56 rows=1 width=71) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Sort (cost=15,017.54..15,017.55 rows=1 width=71) (actual rows= loops=)

  • Sort Key: regel_3.id, adt_1.datum, adt_1.instantiezorgverlener_id, regel_3.nieuwewaarde, logg.tijdelijkeuzipas
33. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.00..15,017.53 rows=1 width=71) (actual rows= loops=)

  • Join Filter: ((adt_1.datum < hapt_call.fiatteertijd) AND (oom.medewerker_id = logg.med_id))
  • Filter: ((logg.id IS NOT NULL) OR ((regel_3.nieuwewaarde)::text <> 'Kan LSP niet bevragen: Er is geen mandaat, communicatie met LSP is niet mogelijk.'::text))
34. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.43..14,774.24 rows=1 width=86) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.15..14,772.91 rows=1 width=78) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Index Scan using idx_fk_hapt_audit_call_id on hapt_audit adt_1 (cost=0.57..318.82 rows=3,241 width=32) (actual rows= loops=)

  • Index Cond: (call_id = hapt_call.id)
37. 0.000 0.000 ↓ 0.0

Index Scan using idx_hapt_auditregel_audit_property on hapt_auditregel regel_3 (cost=0.57..4.45 rows=1 width=62) (actual rows= loops=)

  • Index Cond: ((audit_id = adt_1.id) AND ((property)::text = 'dossierOpvragen'::text))
  • Filter: ((nieuwewaarde)::text ~~ 'Kan LSP niet bevragen:%'::text)
38. 0.000 0.000 ↓ 0.0

Index Scan using sys_c005139 on org_organisatie_medewerker oom (cost=0.29..1.31 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = adt_1.instantiezorgverlener_id)
39. 0.000 0.000 ↓ 0.0

Index Scan using idx_fk_log_loginformatie_call_id on log_loginformatie logg (cost=0.56..242.65 rows=37 width=33) (actual rows= loops=)

  • Index Cond: ((call_id = adt_1.call_id) AND (call_id = hapt_call.id))
  • Filter: (((gebeurtenis)::text = 'CALL_OPENEN'::text) AND (adt_1.datum > (datum - '00:00:01'::interval)) AND (adt_1.datum < (datum + '00:00:01'::interval)))