explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g4GO

Settings
# exclusive inclusive rows x rows loops node
1. 4,507.984 98,901.780 ↓ 1.5 714,721 1

Hash Left Join (cost=121,155.14..223,413.94 rows=490,271 width=311) (actual time=68,549.377..98,901.780 rows=714,721 loops=1)

  • Hash Cond: (c0.current_document_id = d9.id)
2. 531.177 87,941.053 ↓ 1.5 714,721 1

Hash Left Join (cost=84,229.59..137,021.16 rows=490,271 width=311) (actual time=62,072.389..87,941.053 rows=714,721 loops=1)

  • Hash Cond: (c0.id = r7.contract_id)
3. 553.227 87,408.828 ↓ 1.5 714,301 1

Hash Left Join (cost=84,208.31..131,480.65 rows=490,271 width=311) (actual time=62,071.320..87,408.828 rows=714,301 loops=1)

  • Hash Cond: ((o1.id = w3.organization_id) AND (c0.workflow_id = w3.id))
4. 541.015 86,848.935 ↓ 1.5 714,301 1

Hash Left Join (cost=84,029.64..127,619.90 rows=490,271 width=315) (actual time=62,064.313..86,848.935 rows=714,301 loops=1)

  • Hash Cond: (c0.organization_id = o1.id)
5. 12,418.419 86,306.224 ↓ 1.5 714,301 1

Hash Right Join (cost=83,991.10..126,287.78 rows=490,271 width=311) (actual time=62,062.584..86,306.224 rows=714,301 loops=1)

  • Hash Cond: (s5.contract_id = c0.id)
6. 11,869.905 11,869.905 ↑ 1.0 354,950 1

Seq Scan on shares s5 (cost=0.00..18,476.59 rows=355,459 width=8) (actual time=7.502..11,869.905 rows=354,950 loops=1)

7. 3,825.479 62,017.900 ↓ 1.0 491,880 1

Hash (cost=57,753.71..57,753.71 rows=490,271 width=311) (actual time=62,017.900..62,017.900 rows=491,880 loops=1)

  • Buckets: 16,384 Batches: 64 Memory Usage: 1,919kB
8. 58,192.421 58,192.421 ↓ 1.0 491,880 1

Seq Scan on contracts c0 (cost=0.00..57,753.71 rows=490,271 width=311) (actual time=6.170..58,192.421 rows=491,880 loops=1)

9. 1.407 1.696 ↑ 1.0 824 1

Hash (cost=28.24..28.24 rows=824 width=4) (actual time=1.695..1.696 rows=824 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
10. 0.289 0.289 ↑ 1.0 824 1

Seq Scan on organizations o1 (cost=0.00..28.24 rows=824 width=4) (actual time=0.012..0.289 rows=824 loops=1)

11. 3.224 6.666 ↓ 1.0 3,579 1

Hash (cost=125.18..125.18 rows=3,566 width=8) (actual time=6.666..6.666 rows=3,579 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 172kB
12. 2.039 3.442 ↓ 1.0 3,579 1

Hash Left Join (cost=10.67..125.18 rows=3,566 width=8) (actual time=0.777..3.442 rows=3,579 loops=1)

  • Hash Cond: (w3.id = u4.workflow_id)
13. 1.006 1.006 ↓ 1.0 3,579 1

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

14. 0.002 0.397 ↓ 0.0 0 1

Hash (cost=10.65..10.65 rows=2 width=4) (actual time=0.397..0.397 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
15. 0.395 0.395 ↓ 0.0 0 1

Index Scan using users_workflows_permissions_user_id_index on users_workflows_permissions u4 (cost=0.29..10.65 rows=2 width=4) (actual time=0.395..0.395 rows=0 loops=1)

  • Index Cond: (user_id = 4,094)
16. 0.868 1.048 ↓ 1.1 400 1

Hash (cost=16.68..16.68 rows=368 width=16) (actual time=1.048..1.048 rows=400 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 27kB
17. 0.180 0.180 ↓ 1.1 400 1

Seq Scan on reviewers_contract r7 (cost=0.00..16.68 rows=368 width=16) (actual time=0.010..0.180 rows=400 loops=1)

18. 233.258 6,452.743 ↑ 1.0 512,033 1

Hash (cost=27,997.69..27,997.69 rows=513,589 width=16) (actual time=6,452.743..6,452.743 rows=512,033 loops=1)

  • Buckets: 131,072 Batches: 16 Memory Usage: 2,533kB
19. 286.105 6,219.485 ↑ 1.0 512,033 1

Hash Right Join (cost=21,129.82..27,997.69 rows=513,589 width=16) (actual time=3,607.761..6,219.485 rows=512,033 loops=1)

  • Hash Cond: (p10.document_id = d9.id)
20. 10.489 2,338.121 ↓ 1.0 19,948 1

Hash Left Join (cost=71.07..4,184.88 rows=19,833 width=16) (actual time=11.037..2,338.121 rows=19,948 loops=1)

  • Hash Cond: (p10.id = p11.proof_id)
21. 2,326.883 2,326.883 ↓ 1.0 19,948 1

Seq Scan on proofs p10 (cost=0.00..3,965.05 rows=19,833 width=20) (actual time=9.958..2,326.883 rows=19,948 loops=1)

  • Filter: ((status)::text = 'pending'::text)
  • Rows Removed by Filter: 111,846
22. 0.001 0.749 ↓ 0.0 0 1

Hash (cost=71.02..71.02 rows=4 width=4) (actual time=0.748..0.749 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
23. 0.011 0.748 ↓ 0.0 0 1

Bitmap Heap Scan on proofs_subjects p11 (cost=4.55..71.02 rows=4 width=4) (actual time=0.747..0.748 rows=0 loops=1)

  • Recheck Cond: ((email)::text = 'beutingrafael@gmail.com'::text)
  • Filter: ((confirmed_at IS NULL) AND (sent_at IS NOT NULL))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
24. 0.737 0.737 ↑ 17.0 1 1

Bitmap Index Scan on proofs_subjects_email (cost=0.00..4.55 rows=17 width=0) (actual time=0.736..0.737 rows=1 loops=1)

  • Index Cond: ((email)::text = 'beutingrafael@gmail.com'::text)
25. 243.205 3,595.259 ↑ 1.0 512,033 1

Hash (cost=12,130.89..12,130.89 rows=513,589 width=16) (actual time=3,595.259..3,595.259 rows=512,033 loops=1)

  • Buckets: 131,072 Batches: 16 Memory Usage: 2,533kB
26. 3,352.054 3,352.054 ↑ 1.0 512,033 1

Seq Scan on documents d9 (cost=0.00..12,130.89 rows=513,589 width=16) (actual time=1.808..3,352.054 rows=512,033 loops=1)

Planning time : 28.221 ms
Execution time : 99,079.755 ms