explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ILMF

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

Nested Loop Left Join (cost=378,851.58..665,899.63 rows=45 width=2,571) (actual rows= loops=)

  • Join Filter: (doc.artifact_id = af.artifact_id)
2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=249,183.15..519,573.90 rows=45 width=2,360) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Hash Join (cost=249,182.72..519,551.89 rows=46 width=413) (actual rows= loops=)

  • Hash Cond: (p_d.artifact_id = pac.artifact_id)
4. 0.000 0.000 ↓ 0.0

Seq Scan on study_level_activity_predecessors p_d (cost=0.00..262,409.24 rows=2,122,524 width=12) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash (cost=249,182.45..249,182.45 rows=22 width=409) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=203,738.83..249,182.45 rows=22 width=409) (actual rows= loops=)

  • Hash Cond: ((per.study_country_id = act_1.study_country_id) AND (COALESCE(per.study_site_id, '-1'::integer) = COALESCE(act_1.study_site_id, '-1'::integer)) AND (per.business_role_id = act_1.business_role_id))
7. 0.000 0.000 ↓ 0.0

Seq Scan on study_level_personnel per (cost=0.00..43,038.65 rows=160,330 width=84) (actual rows= loops=)

  • Filter: is_primary
8. 0.000 0.000 ↓ 0.0

Hash (cost=203,738.44..203,738.44 rows=22 width=349) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..203,738.44 rows=22 width=349) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on matv_pe_study_level_activities act_1 (cost=0.00..195,422.56 rows=4,192 width=102) (actual rows= loops=)

  • Filter: ((artifact_activity_action)::text = 'approveip'::text)
11. 0.000 0.000 ↓ 0.0

Index Scan using index_artifact_id on study_level_artifacts pac (cost=0.42..1.97 rows=1 width=247) (actual rows= loops=)

  • Index Cond: (artifact_id = act_1.artifact_id)
  • Filter: (pre_ip_release_review IS TRUE)
12. 0.000 0.000 ↓ 0.0

Index Scan using index_artifact_id on study_level_artifacts doc (cost=0.42..0.47 rows=1 width=1,951) (actual rows= loops=)

  • Index Cond: (artifact_id = p_d.pre_artifact_id)
  • Filter: ((artifact_type)::text = 'Document'::text)
13. 0.000 0.000 ↓ 0.0

Materialize (cost=129,668.43..145,276.63 rows=1,560 width=215) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Subquery Scan on af (cost=129,668.43..145,268.83 rows=1,560 width=215) (actual rows= loops=)

  • Filter: (af.created_at = af.latest_created_at)
15. 0.000 0.000 ↓ 0.0

WindowAgg (cost=129,668.43..141,368.73 rows=312,008 width=775) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

WindowAgg (cost=129,668.43..135,908.59 rows=312,008 width=215) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Sort (cost=129,668.43..130,448.45 rows=312,008 width=207) (actual rows= loops=)

  • Sort Key: art.attached_id, fil.created_at
18. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,824.65..39,336.79 rows=312,008 width=207) (actual rows= loops=)

  • Hash Cond: (fil.user_id = u.id)
19. 0.000 0.000 ↓ 0.0

Merge Join (cost=1.86..33,220.41 rows=312,936 width=153) (actual rows= loops=)

  • Merge Cond: (art.id = fil.attachment_id)
20. 0.000 0.000 ↓ 0.0

Index Scan using attachments_pkey on attachments art (cost=0.42..8,959.74 rows=245,731 width=8) (actual rows= loops=)

  • Filter: ((attached_type)::text = 'Artifact'::text)
21. 0.000 0.000 ↓ 0.0

Index Scan using index_attachment_versions_on_attachment_id on attachment_versions fil (cost=0.42..19,778.64 rows=320,077 width=153) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Hash (cost=1,674.16..1,674.16 rows=11,891 width=62) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users u (cost=0.29..1,674.16 rows=11,891 width=62) (actual rows= loops=)