explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pyQe

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

Group (cost=426,360,732,468.19..454,077,430,974.79 rows=791,905,671,617 width=117) (actual rows= loops=)

  • Group Key: ps.name, psi.created, coc.name, psi.deleted, psi.uid, tei.value, tei1.value, tei2.value, tei3.value, tei4.value, tei5.value, psi.storedby, ou.name
2. 0.000 0.000 ↓ 0.0

Sort (cost=426,360,732,468.19..428,340,496,647.24 rows=791,905,671,617 width=117) (actual rows= loops=)

  • Sort Key: ps.name, psi.created, coc.name, psi.deleted, psi.uid, tei.value, tei1.value, tei2.value, tei3.value, tei4.value, tei5.value, psi.storedby, ou.name
3. 0.000 0.000 ↓ 0.0

Gather (cost=29,068,020,137.49..184,244,951,962.17 rows=791,905,671,617 width=117) (actual rows= loops=)

  • Workers Planned: 4
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=29,068,019,137.49..105,054,383,800.47 rows=197,976,417,904 width=117) (actual rows= loops=)

  • Hash Cond: (tei.dataelementid = de.dataelementid)
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=29,068,019,132.44..102,332,208,049.25 rows=197,976,417,904 width=121) (actual rows= loops=)

  • Hash Cond: (psi.attributeoptioncomboid = coc.categoryoptioncomboid)
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=29,068,017,687.60..99,610,030,858.22 rows=197,976,417,904 width=107) (actual rows= loops=)

  • Hash Cond: (psi.organisationunitid = ou.organisationunitid)
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=29,068,015,946.83..96,887,853,371.27 rows=197,976,417,904 width=92) (actual rows= loops=)

  • Hash Cond: (tei.programstageinstanceid = psi.programstageinstanceid)
  • Join Filter: ((tei.dataelementid = 7258) OR (tei1.dataelementid = 7232) OR (tei2.dataelementid = 7209) OR (tei3.dataelementid = 7210) OR (tei4.dataelementid = 7211) OR ((tei5.dataelementid = 7212) AND (ps.programstageid = ANY ('{8730837,8730976,8731010}'::integer[])) AND (NOT psi.deleted)))
8. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on trackedentitydatavalue tei (cost=0.00..432,524.21 rows=8,603,620 width=11) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=9,826,836,339.82..9,826,836,339.82 rows=600,700,241,361 width=133) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Merge Join (cost=33.50..9,826,836,339.82 rows=600,700,241,361 width=133) (actual rows= loops=)

  • Merge Cond: (tei5.programstageinstanceid = psi.programstageinstanceid)
11. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei5 (cost=0.44..970,977.55 rows=34,414,482 width=11) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Materialize (cost=26.88..989,480,777.80 rows=52,261,114,154 width=122) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Merge Join (cost=26.88..858,827,992.42 rows=52,261,114,154 width=122) (actual rows= loops=)

  • Merge Cond: (tei4.programstageinstanceid = psi.programstageinstanceid)
14. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei4 (cost=0.44..970,977.55 rows=34,414,482 width=11) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Materialize (cost=20.27..89,065,143.76 rows=4,546,733,736 width=111) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Merge Join (cost=20.27..77,698,309.42 rows=4,546,733,736 width=111) (actual rows= loops=)

  • Merge Cond: (tei3.programstageinstanceid = psi.programstageinstanceid)
17. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei3 (cost=0.44..970,977.55 rows=34,414,482 width=11) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Materialize (cost=13.66..9,801,514.82 rows=395,567,297 width=100) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Merge Join (cost=13.66..8,812,596.58 rows=395,567,297 width=100) (actual rows= loops=)

  • Merge Cond: (tei2.programstageinstanceid = psi.programstageinstanceid)
20. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei2 (cost=0.44..970,977.55 rows=34,414,482 width=11) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Materialize (cost=7.04..1,960,946.65 rows=34,414,482 width=89) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Merge Join (cost=7.04..1,874,910.44 rows=34,414,482 width=89) (actual rows= loops=)

  • Merge Cond: (psi.programstageinstanceid = tei1.programstageinstanceid)
23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..475,171.60 rows=2,994,071 width=78) (actual rows= loops=)

  • Join Filter: (psi.programstageid = ps.programstageid)
24. 0.000 0.000 ↓ 0.0

Index Scan using programstageinstance_pkey on programstageinstance psi (cost=0.43..115,881.98 rows=2,994,071 width=47) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..1.12 rows=8 width=35) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Seq Scan on programstage ps (cost=0.00..1.08 rows=8 width=35) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei1 (cost=0.44..970,977.55 rows=34,414,482 width=11) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Hash (cost=1,488.12..1,488.12 rows=20,212 width=23) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Seq Scan on organisationunit ou (cost=0.00..1,488.12 rows=20,212 width=23) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Hash (cost=909.93..909.93 rows=42,793 width=22) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Seq Scan on categoryoptioncombo coc (cost=0.00..909.93 rows=42,793 width=22) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Hash (cost=3.91..3.91 rows=91 width=4) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Seq Scan on dataelement de (cost=0.00..3.91 rows=91 width=4) (actual rows= loops=)