explain.depesz.com

PostgreSQL's explain analyze made readable

Result: z4pj

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

Group (cost=2,348,620,185.58..2,495,636,805.31 rows=4,900,553,991 width=111) (actual rows= loops=)

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

Sort (cost=2,348,620,185.58..2,360,871,570.55 rows=4,900,553,991 width=111) (actual rows= loops=)

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

Gather (cost=215,106,531.46..1,226,305,624.75 rows=4,900,553,991 width=111) (actual rows= loops=)

  • Workers Planned: 4
4. 0.000 0.000 ↓ 0.0

Hash Join (cost=215,105,531.46..736,249,225.65 rows=1,225,138,498 width=111) (actual rows= loops=)

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

Hash Join (cost=215,105,526.41..719,403,566.25 rows=1,225,138,498 width=115) (actual rows= loops=)

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

Hash Join (cost=215,104,081.57..702,556,467.06 rows=1,225,138,498 width=101) (actual rows= loops=)

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

Hash Join (cost=215,102,340.80..685,709,071.94 rows=1,225,138,498 width=86) (actual rows= loops=)

  • Hash Cond: (tei5.programstageinstanceid = psi.programstageinstanceid)
  • Join Filter: ((tei.dataelementid = 7258) OR (tei1.dataelementid = 7232) OR (tei2.dataelementid = 7209) OR ((tei5.dataelementid = 7212) AND (ps.programstageid = ANY ('{8730837,8730976,8731010}'::integer[])) AND (NOT psi.deleted) AND (psi.executiondate > '2019-01-01 00:00:00'::timestamp without time zone)))
8. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on trackedentitydatavalue tei5 (cost=0.00..435,753.23 rows=8,644,423 width=11) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Hash (cost=78,589,051.49..78,589,051.49 rows=4,538,623,625 width=119) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Merge Join (cost=302.47..78,589,051.49 rows=4,538,623,625 width=119) (actual rows= loops=)

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

Merge Join (cost=61.24..8,830,479.26 rows=396,150,382 width=108) (actual rows= loops=)

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

Merge Join (cost=12.80..1,870,826.15 rows=34,577,691 width=97) (actual rows= loops=)

  • Merge Cond: (psi.programstageinstanceid = tei.programstageinstanceid)
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.43..478,974.13 rows=3,018,088 width=86) (actual rows= loops=)

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

Index Scan using programstageinstance_pkey on programstageinstance psi (cost=0.43..116,802.47 rows=3,018,088 width=55) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

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

16. 0.000 0.000 ↓ 0.0

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

17. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei (cost=0.44..976,946.04 rows=34,577,691 width=11) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Materialize (cost=0.44..1,063,390.27 rows=34,577,691 width=11) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei1 (cost=0.44..976,946.04 rows=34,577,691 width=11) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Materialize (cost=0.44..1,063,390.27 rows=34,577,691 width=11) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using index_trackedentitydatavalue_programstageinstanceid on trackedentitydatavalue tei2 (cost=0.44..976,946.04 rows=34,577,691 width=11) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

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

23. 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=)

24. 0.000 0.000 ↓ 0.0

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

25. 0.000 0.000 ↓ 0.0

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

26. 0.000 0.000 ↓ 0.0

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

27. 0.000 0.000 ↓ 0.0

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