explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gUyn

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 224.405 11,851.667 ↑ 1.2 2,409 1

Aggregate (cost=84,088.45..84,210.47 rows=2,871 width=438) (actual time=11,849.608..11,851.667 rows=2,409 loops=1)

  • Buffers: shared hit=63651
2. 505.169 11,627.262 ↑ 1.2 2,409 1

Aggregate (cost=83,643.45..83,765.46 rows=2,871 width=438) (actual time=11,560.4..11,627.262 rows=2,409 loops=1)

  • Buffers: shared hit=63651
3. 597.342 11,122.093 ↓ 2.1 5,943 1

Hash Join (cost=4,186.87..83,456.83 rows=2,871 width=438) (actual time=2,194.726..11,122.093 rows=5,943 loops=1)

  • Buffers: shared hit=63651
4. 234.928 10,524.622 ↓ 2.1 5,943 1

Hash Join (cost=4,179.28..83,415.28 rows=2,871 width=415) (actual time=2,194.575..10,524.622 rows=5,943 loops=1)

  • Buffers: shared hit=63648
5. 167.256 9,902.407 ↓ 2.1 5,943 1

Nested Loop (cost=3,365.29..82,407.86 rows=2,871 width=375) (actual time=1,807.242..9,902.407 rows=5,943 loops=1)

  • Buffers: shared hit=63330
6. 162.602 8,340.646 ↓ 3.5 5,985 1

Hash Join (cost=3,364.87..78,604.51 rows=1,731 width=391) (actual time=1,807.223..8,340.646 rows=5,985 loops=1)

  • Buffers: shared hit=39345
7. 130.591 8,177.883 ↓ 3.5 5,985 1

Hash Join (cost=3,356.26..78,587.98 rows=1,731 width=359) (actual time=1,807.046..8,177.883 rows=5,985 loops=1)

  • Buffers: shared hit=39341
8. 213.514 8,044.997 ↓ 3.5 5,985 1

Nested Loop (cost=3,200.69..78,358.82 rows=1,731 width=351) (actual time=1,804.741..8,044.997 rows=5,985 loops=1)

  • Buffers: shared hit=39269
9. 161.420 2,567.563 ↓ 1.4 2,437 1

Hash Join (cost=3,159.94..7,772.49 rows=1,731 width=330) (actual time=1,804.697..2,567.563 rows=2,437 loops=1)

  • Buffers: shared hit=10639
10. 601.469 601.469 ↓ 37.2 1,599 1

Seq Scan on contractroles ccn (cost=0..4,612.1 rows=43 width=32) (actual time=0.012..601.469 rows=1,599 loops=1)

  • Filter: ((ccn.party = 'COUNTERPARTY'::text) AND (ccn.role = 'Negotiator'::text))
  • Buffers: shared hit=2080
11. 2.808 1,804.674 ↓ 1.4 2,437 1

Hash (cost=3,138.3..3,138.3 rows=1,731 width=314) (actual time=1,804.674..1,804.674 rows=2,437 loops=1)

  • Buffers: shared hit=8559
12. 119.326 1,801.866 ↓ 1.4 2,437 1

Nested Loop (cost=575.11..3,138.3 rows=1,731 width=314) (actual time=571.889..1,801.866 rows=2,437 loops=1)

  • Buffers: shared hit=8559
13. 3.237 1,051.357 ↓ 1.4 2,437 1

Hash Join (cost=575.11..3,011.06 rows=1,731 width=79) (actual time=571.871..1,051.357 rows=2,437 loops=1)

  • Buffers: shared hit=1248
14. 476.295 476.295 ↓ 1.0 2,437 1

Seq Scan on contractsview uc (cost=0..2,364.7 rows=2,332 width=55) (actual time=0.008..476.295 rows=2,437 loops=1)

  • Filter: (uc.userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Buffers: shared hit=1117
15. 192.036 571.825 ↓ 1.4 12,560 1

Hash (cost=437.2..437.2 rows=9,194 width=33) (actual time=571.825..571.825 rows=12,560 loops=1)

  • Buffers: shared hit=131
16. 379.789 379.789 ↓ 1.4 12,560 1

Seq Scan on entitystatus es (cost=0..437.2 rows=9,194 width=33) (actual time=0.005..379.789 rows=12,560 loops=1)

  • Filter: ((es.status <> ALL ('{NEGOTIATING,NAPPROVING,NAPPROVED,EXECUTED,NSIGNING,NSIGNED}'::text[])) OR (es.status = ANY ('{NEGOTIATING,NAPPROVING,NAPPROVED,EXECUTED,NSIGNING,NSIGNED}'::text[])))
  • Buffers: shared hit=131
17. 631.183 631.183 ↑ 1.0 1 2,437

Index Scan using cp_id on contract co (cost=0..0.06 rows=1 width=235) (actual time=0.25..0.259 rows=1 loops=2,437)

  • Index Cond: (co.id = es.entityid)
  • Buffers: shared hit=7311
18. 21.933 5,263.920 ↓ 2.0 2 2,437

Subquery Scan on di (cost=40.75..40.77 rows=1 width=37) (actual time=2.071..2.16 rows=2 loops=2,437)

  • Filter: (di.contractid = uc.contractid)
  • Buffers: shared hit=28630
19. 365.550 5,241.987 ↓ 2.0 2 2,437

Aggregate (cost=40.75..40.76 rows=1 width=59) (actual time=2.07..2.151 rows=2 loops=2,437)

  • Buffers: shared hit=28630
20. 1,681.423 4,876.437 ↓ 2.0 2 2,437

Nested Loop (cost=4.47..40.72 rows=1 width=59) (actual time=1.284..2.001 rows=2 loops=2,437)

  • Buffers: shared hit=28630
21. 918.749 918.749 ↓ 2.0 2 2,437

Index Scan using documentrolesview_contractid_documentid_userid_idx on documentrolesview uci (cost=0.42..13.21 rows=1 width=56) (actual time=0.268..0.377 rows=2 loops=2,437)

  • Index Cond: ((uci.contractid = uc.contractid) AND (uci.userid = uc.userid))
  • Buffers: shared hit=12429
22. 753.495 2,276.265 ↑ 1.2 4 3,945

Bitmap Heap Scan on discussion dii (cost=4.05..24.81 rows=5 width=71) (actual time=0.503..0.577 rows=4 loops=3,945)

  • Filter: ((NOT dii.cancelled) AND ((NOT dii.external) OR dii.external OR dii.containsinternal OR dii.cpcontainsinternal) AND (dii.status <> 'HIDDEN'::text))
  • Buffers: shared hit=13036
23. 1,522.770 1,522.770 ↑ 1.5 4 3,945

Bitmap Index Scan on di_contractid (cost=0..4.04 rows=6 width=0) (actual time=0.386..0.386 rows=4 loops=3,945)

  • Index Cond: (dii.contractid = uc.contractid)
  • Buffers: shared hit=7890
24. 0.190 2.295 ↓ 1.8 572 1

Hash (cost=151.67..151.67 rows=312 width=24) (actual time=2.295..2.295 rows=572 loops=1)

  • Buffers: shared hit=72
25. 0.983 2.105 ↓ 1.8 572 1

Aggregate (cost=145.43..148.55 rows=312 width=16) (actual time=1.945..2.105 rows=572 loops=1)

  • Buffers: shared hit=72
26. 1.122 1.122 ↓ 1.0 2,192 1

Seq Scan on userdiscussions udsc (cost=0..134.78 rows=2,131 width=16) (actual time=0.013..1.122 rows=2,192 loops=1)

  • Filter: (udsc.userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Buffers: shared hit=72
27. 0.075 0.161 ↑ 1.0 205 1

Hash (cost=6.05..6.05 rows=205 width=48) (actual time=0.161..0.161 rows=205 loops=1)

  • Buffers: shared hit=4
28. 0.086 0.086 ↑ 1.0 205 1

Seq Scan on additionaldata ad (cost=0..6.05 rows=205 width=48) (actual time=0.004..0.086 rows=205 loops=1)

  • Buffers: shared hit=4
29. 1,394.505 1,394.505 ↑ 2.0 1 5,985

Index Scan using idx_contractoles_roles on contractroles cn (cost=0.42..2.17 rows=2 width=32) (actual time=0.233..0.233 rows=1 loops=5,985)

  • Index Cond: ((cn.contractid = es.entityid) AND (cn.party = 'PARTY'::text) AND (cn.role = 'Negotiator'::text))
  • Buffers: shared hit=23985
30. 185.822 387.287 ↓ 1.1 4,978 1

Hash (cost=743.03..743.03 rows=4,731 width=88) (actual time=387.287..387.287 rows=4,978 loops=1)

  • Buffers: shared hit=318
31. 201.465 201.465 ↓ 1.1 4,978 1

Seq Scan on entityaccessed ea (cost=0..743.03 rows=4,731 width=88) (actual time=0.012..201.465 rows=4,978 loops=1)

  • Filter: (ea.userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Buffers: shared hit=318
32. 0.072 0.129 ↑ 1.1 186 1

Hash (cost=5.04..5.04 rows=204 width=39) (actual time=0.129..0.129 rows=186 loops=1)

  • Buffers: shared hit=3
33. 0.057 0.057 ↑ 1.1 186 1

Seq Scan on tenant ti (cost=0..5.04 rows=204 width=39) (actual time=0.005..0.057 rows=186 loops=1)

  • Buffers: shared hit=3