explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5yLj

Settings
# exclusive inclusive rows x rows loops node
1. 27.986 12,280.574 ↑ 5,531.8 37 1

Gather (cost=42,726.47..156,382.30 rows=204,676 width=311) (actual time=11,986.336..12,280.574 rows=37 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.678 12,252.588 ↑ 7,106.8 12 3 / 3

Parallel Hash Left Join (cost=41,726.47..134,914.70 rows=85,282 width=311) (actual time=11,995.635..12,252.588 rows=12 loops=3)

  • Hash Cond: (d9.id = p10.document_id)
3. 277.147 12,116.693 ↑ 7,106.8 12 3 / 3

Parallel Hash Left Join (cost=38,132.74..127,570.52 rows=85,282 width=327) (actual time=11,859.771..12,116.693 rows=12 loops=3)

  • Hash Cond: (c0.current_document_id = d9.id)
4. 176.239 11,335.181 ↑ 7,106.8 12 3 / 3

Hash Left Join (cost=25,277.85..106,450.76 rows=85,282 width=311) (actual time=9,633.504..11,335.181 rows=12 loops=3)

  • Hash Cond: (r7.reviewer_id = r8.id)
  • Filter: (((o2.role)::text = 'administrator'::text) OR (c0.owner_id = 761) OR ((o2.id IS NOT NULL) AND (u4.id IS NOT NULL)) OR (p6.id IS NOT NULL) OR (r8.id IS NOT NULL))
  • Rows Removed by Filter: 227,220
5. 323.376 11,158.911 ↓ 2.7 227,232 3 / 3

Hash Left Join (cost=25,272.89..106,213.11 rows=85,282 width=342) (actual time=9,368.850..11,158.911 rows=227,232 loops=3)

  • Hash Cond: (c0.id = r7.contract_id)
6. 327.170 10,833.111 ↓ 2.7 227,096 3 / 3

Parallel Hash Left Join (cost=25,251.61..105,231.77 rows=85,282 width=334) (actual time=9,365.031..10,833.111 rows=227,096 loops=3)

  • Hash Cond: (s5.party_id = p6.id)
7. 333.702 10,172.819 ↓ 2.7 227,096 3 / 3

Hash Left Join (cost=19,052.95..98,809.24 rows=85,282 width=334) (actual time=9,031.579..10,172.819 rows=227,096 loops=3)

  • Hash Cond: (o1.id = o2.organization_id)
8. 1,090.215 9,838.984 ↓ 2.7 227,096 3 / 3

Parallel Hash Left Join (cost=19,044.64..98,575.92 rows=85,282 width=323) (actual time=9,031.432..9,838.984 rows=227,096 loops=3)

  • Hash Cond: (c0.id = s5.contract_id)
9. 133.192 7,233.070 ↓ 1.9 158,405 3 / 3

Hash Left Join (cost=211.21..56,284.49 rows=85,282 width=319) (actual time=15.807..7,233.070 rows=158,405 loops=3)

  • Hash Cond: ((o1.id = w3.organization_id) AND (c0.workflow_id = w3.id))
10. 137.681 7,085.412 ↓ 1.9 158,405 3 / 3

Hash Join (cost=32.54..55,465.33 rows=85,282 width=315) (actual time=1.331..7,085.412 rows=158,405 loops=3)

  • Hash Cond: (c0.organization_id = o1.id)
11. 6,947.092 6,947.092 ↑ 1.2 163,960 3 / 3

Parallel Seq Scan on contracts c0 (cost=0.00..54,893.80 rows=204,280 width=311) (actual time=0.676..6,947.092 rows=163,960 loops=3)

12. 0.117 0.639 ↑ 1.0 344 3 / 3

Hash (cost=28.24..28.24 rows=344 width=4) (actual time=0.638..0.639 rows=344 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
13. 0.522 0.522 ↑ 1.0 344 3 / 3

Seq Scan on organizations o1 (cost=0.00..28.24 rows=344 width=4) (actual time=0.015..0.522 rows=344 loops=3)

  • Filter: active
  • Rows Removed by Filter: 480
14. 1.190 14.466 ↓ 1.0 3,579 3 / 3

Hash (cost=125.18..125.18 rows=3,566 width=12) (actual time=14.465..14.466 rows=3,579 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 172kB
15. 5.473 13.276 ↓ 1.0 3,579 3 / 3

Hash Left Join (cost=10.67..125.18 rows=3,566 width=12) (actual time=0.286..13.276 rows=3,579 loops=3)

  • Hash Cond: (w3.id = u4.workflow_id)
16. 7.538 7.538 ↓ 1.0 3,579 3 / 3

Seq Scan on workflows w3 (cost=0.00..96.66 rows=3,566 width=8) (actual time=0.009..7.538 rows=3,579 loops=3)

17. 0.001 0.265 ↓ 0.0 0 3 / 3

Hash (cost=10.65..10.65 rows=2 width=8) (actual time=0.264..0.265 rows=0 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
18. 0.264 0.264 ↓ 0.0 0 3 / 3

Index Scan using users_workflows_permissions_user_id_index on users_workflows_permissions u4 (cost=0.29..10.65 rows=2 width=8) (actual time=0.264..0.264 rows=0 loops=3)

  • Index Cond: (user_id = 761)
19. 54.799 1,515.699 ↑ 1.3 118,317 3 / 3

Parallel Hash (cost=16,403.08..16,403.08 rows=148,108 width=8) (actual time=1,515.699..1,515.699 rows=118,317 loops=3)

  • Buckets: 131,072 Batches: 8 Memory Usage: 2,816kB
20. 1,460.900 1,460.900 ↑ 1.3 118,317 3 / 3

Parallel Seq Scan on shares s5 (cost=0.00..16,403.08 rows=148,108 width=8) (actual time=0.746..1,460.900 rows=118,317 loops=3)

21. 0.001 0.133 ↓ 0.0 0 3 / 3

Hash (cost=8.30..8.30 rows=1 width=19) (actual time=0.133..0.133 rows=0 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
22. 0.132 0.132 ↓ 0.0 0 3 / 3

Index Scan using organizations_users_user_id_index on organizations_users o2 (cost=0.28..8.30 rows=1 width=19) (actual time=0.132..0.132 rows=0 loops=3)

  • Index Cond: (user_id = 761)
23. 0.255 333.122 ↑ 1.0 1 3 / 3

Parallel Hash (cost=6,198.65..6,198.65 rows=1 width=4) (actual time=333.122..333.122 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 72kB
24. 332.867 332.867 ↑ 1.0 1 3 / 3

Parallel Seq Scan on parties p6 (cost=0.00..6,198.65 rows=1 width=4) (actual time=134.931..332.867 rows=1 loops=3)

  • Filter: ((email)::text = 'lucas.rodrigues@sambatech.com.br'::text)
  • Rows Removed by Filter: 54,030
25. 0.126 2.424 ↓ 1.1 400 3 / 3

Hash (cost=16.68..16.68 rows=368 width=16) (actual time=2.423..2.424 rows=400 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 27kB
26. 2.298 2.298 ↓ 1.1 400 3 / 3

Seq Scan on reviewers_contract r7 (cost=0.00..16.68 rows=368 width=16) (actual time=0.016..2.298 rows=400 loops=3)

27. 0.001 0.031 ↓ 0.0 0 3 / 3

Hash (cost=4.95..4.95 rows=1 width=8) (actual time=0.031..0.031 rows=0 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
28. 0.030 0.030 ↓ 0.0 0 3 / 3

Seq Scan on reviewers r8 (cost=0.00..4.95 rows=1 width=8) (actual time=0.030..0.030 rows=0 loops=3)

  • Filter: ((email)::text = 'lucas.rodrigues@sambatech.com.br'::text)
  • Rows Removed by Filter: 176
29. 217.374 504.365 ↑ 1.3 170,678 3 / 3

Parallel Hash (cost=9,134.95..9,134.95 rows=213,995 width=16) (actual time=504.364..504.365 rows=170,678 loops=3)

  • Buckets: 131,072 Batches: 16 Memory Usage: 2,592kB
30. 286.991 286.991 ↑ 1.3 170,678 3 / 3

Parallel Seq Scan on documents d9 (cost=0.00..9,134.95 rows=213,995 width=16) (actual time=2.809..286.991 rows=170,678 loops=3)

31. 4.602 135.217 ↑ 1.8 6,649 3 / 3

Parallel Hash (cost=3,447.90..3,447.90 rows=11,666 width=16) (actual time=135.217..135.217 rows=6,649 loops=3)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,248kB
32. 3.429 130.615 ↑ 1.8 6,649 3 / 3

Hash Left Join (cost=71.07..3,447.90 rows=11,666 width=16) (actual time=0.765..130.615 rows=6,649 loops=3)

  • Hash Cond: (p10.id = p11.proof_id)
33. 126.674 126.674 ↑ 1.8 6,649 3 / 3

Parallel Seq Scan on proofs p10 (cost=0.00..3,289.32 rows=11,666 width=20) (actual time=0.232..126.674 rows=6,649 loops=3)

  • Filter: ((status)::text = 'pending'::text)
  • Rows Removed by Filter: 37,282
34. 0.005 0.512 ↑ 4.0 1 3 / 3

Hash (cost=71.02..71.02 rows=4 width=4) (actual time=0.512..0.512 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
35. 0.022 0.507 ↑ 4.0 1 3 / 3

Bitmap Heap Scan on proofs_subjects p11 (cost=4.55..71.02 rows=4 width=4) (actual time=0.502..0.507 rows=1 loops=3)

  • Recheck Cond: ((email)::text = 'lucas.rodrigues@sambatech.com.br'::text)
  • Filter: ((confirmed_at IS NULL) AND (sent_at IS NOT NULL))
  • Rows Removed by Filter: 7
  • Heap Blocks: exact=8
36. 0.485 0.485 ↑ 2.1 8 3 / 3

Bitmap Index Scan on proofs_subjects_email (cost=0.00..4.55 rows=17 width=0) (actual time=0.485..0.485 rows=8 loops=3)

  • Index Cond: ((email)::text = 'lucas.rodrigues@sambatech.com.br'::text)
Planning time : 29.739 ms
Execution time : 12,280.845 ms