explain.depesz.com

PostgreSQL's explain analyze made readable

Result: D2Kv

Settings
# exclusive inclusive rows x rows loops node
1. 1.456 39,872.820 ↑ 17.5 1,518 1

Unique (cost=164,082.85..168,255.65 rows=26,494 width=1,208) (actual time=39,870.930..39,872.820 rows=1,518 loops=1)

2. 2.525 39,871.364 ↑ 17.5 1,518 1

Sort (cost=164,082.85..164,149.08 rows=26,494 width=1,208) (actual time=39,870.928..39,871.364 rows=1,518 loops=1)

  • Sort Key: co.id, co.userid, co.creationdate, co.duedate, co.value, co.valueccy, uc.statuschanged, co.name, co.cancelled, co.counterpartycompanyid, co.companyid, co.tenantid, uc.party, co.hybrid, ad.effectivedate, co.notes, cn.userid, ccn.userid, ((count(1) FILTER (WHERE di.nonstandardterm) > 0)), (count(*) FILTER (WHERE ((di.status <> 'CLOSED'::text) AND ((di.queued AND (di.party = 'PARTY'::text)) OR (di.cpqueued AND (di.party = 'COUNTERPARTY'::text)))))), (count(*) FILTER (WHERE (di.status = 'CLOSED'::text))), (count(DISTINCT di.id) FILTER (WHERE (di.status <> 'CLOSED'::text))), ((count(1) FILTER (WHERE di.external) > 0)), (((count(*) FILTER (WHERE (di.status <> 'CLOSED'::text)) - (count(*))))::integer), co.readysign, ti.name, (CASE WHEN ((es.status <> 'TERMINATED'::text) AND (((ad.expirationdate)::date - ('now'::cstring)::date) < 0)) THEN 'EXPIRED'::text WHEN (es.status = ANY ('{NEXECUTED,EXECUTED,CANCELLED,NCANCELLED}'::text[])) THEN es.status WHEN co.cancelled THEN 'CANCELLED'::text WHEN co.terminated THEN 'TERMINATED'::text ELSE uc.status END), ((count(ea.*) = 0)), co.createdasexecuted, ad.renewaldate, ad.expirationdate, co.counterpartypaper, co.terminated, co.categoryid, co.entityid, co.divisionid, co.countryid, co.regionid, co.side, ad.signdate, (CASE WHEN (uc.party = 'COUNTERPARTY'::text) THEN false ELSE co.haslinkedcontracts END), co.last_activity, aseq.id, aseq.seq_name, aseq.is_cycle, aseq.is_zero_fill, aseq.increment_by, aseq.min_val, aseq.max_val, aseq.start_on, aseq.scope, aseq.created_at, (max(asa.contract_num_val)), ((('cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid = cn.userid) OR (count(dr_query.*) > 0))), ((count(docs.id) > 0)), ((count(*) FILTER (WHERE (dr_query.role = 'Reviewer'::text)) > 0)), reviewers_query.has_posts_by_reviwer, reviewers_query.has_not_registred_reviewers
  • Sort Method: quicksort Memory: 938kB
3. 6,129.551 39,868.839 ↑ 17.5 1,518 1

GroupAggregate (cost=144,214.82..148,188.92 rows=26,494 width=1,208) (actual time=30,301.522..39,868.839 rows=1,518 loops=1)

  • Group Key: co.id, es.status, uc.statuschanged, uc.party, uc.status, (count(*)), ti.name, ad.effectivedate, cn.userid, ccn.userid, ad.expirationdate, ad.renewaldate, ad.signdate, aseq.id, reviewers_query.has_posts_by_reviwer, reviewers_query.has_not_registred_reviewers
  • Filter: ((uc.party = 'PARTY'::text) OR (count(CASE WHEN docs.shared THEN 1 ELSE NULL::integer END) > 0))
4. 22,214.543 33,739.288 ↓ 115.5 3,059,183 1

Sort (cost=144,214.82..144,281.05 rows=26,494 width=1,208) (actual time=30,301.452..33,739.288 rows=3,059,183 loops=1)

  • Sort Key: co.id, es.status, uc.statuschanged, uc.party, uc.status, (count(*)), ti.name, ad.effectivedate, cn.userid, ccn.userid, ad.expirationdate, ad.renewaldate, ad.signdate, aseq.id, reviewers_query.has_posts_by_reviwer, reviewers_query.has_not_registred_reviewers
  • Sort Method: external sort Disk: 1,957,800kB
5. 2,945.624 11,524.745 ↓ 115.5 3,059,183 1

Hash Left Join (cost=28,023.66..128,320.88 rows=26,494 width=1,208) (actual time=120.338..11,524.745 rows=3,059,183 loops=1)

  • Hash Cond: (dr_query.documentid = a_approver.document_id)
  • Filter: (((uc.party = 'PARTY'::text) AND ((COALESCE(a_state.type, 'BASIC'::text) = 'BASIC'::text) OR (a_approver.current IS TRUE) OR (a_approver.approve IS TRUE) OR (not_approver_only_d.role IS NOT NULL) OR (contract_roles.role IS NOT NULL))) OR (uc.status = ANY ('{NEGOTIATING,NAPPROVING,NAPPROVED,EXECUTED,NSIGNING,NSIGNED}'::text[])))
6. 2,419.355 8,579.069 ↓ 115.5 3,059,183 1

Hash Left Join (cost=28,010.84..128,208.29 rows=26,494 width=1,285) (actual time=120.276..8,579.069 rows=3,059,183 loops=1)

  • Hash Cond: (dr_query.documentid = a_state.document_id)
7. 3,521.225 6,159.549 ↓ 115.5 3,059,183 1

Merge Right Join (cost=27,976.77..124,512.92 rows=26,494 width=1,253) (actual time=120.097..6,159.549 rows=3,059,183 loops=1)

  • Merge Cond: (docs.contractid = co.id)
8. 4.553 8.591 ↑ 1.0 4,421 1

Sort (cost=1,108.38..1,119.67 rows=4,518 width=33) (actual time=6.549..8.591 rows=4,421 loops=1)

  • Sort Key: docs.contractid
  • Sort Method: quicksort Memory: 538kB
9. 4.038 4.038 ↑ 1.0 4,421 1

Seq Scan on documents docs (cost=0.00..834.10 rows=4,518 width=33) (actual time=0.007..4.038 rows=4,421 loops=1)

  • Filter: ((NOT cancelled) AND (NOT removed) AND (status <> ALL ('{SIGNED,NSIGNED}'::text[])))
  • Rows Removed by Filter: 1,747
10. 1,882.573 2,629.733 ↓ 144.0 3,059,181 1

Materialize (cost=26,868.39..123,037.65 rows=21,246 width=1,236) (actual time=113.542..2,629.733 rows=3,059,181 loops=1)

11. 123.075 747.160 ↓ 5.6 119,114 1

Merge Left Join (cost=26,868.39..122,984.54 rows=21,246 width=1,236) (actual time=113.536..747.160 rows=119,114 loops=1)

  • Merge Cond: (co.id = reviewers_query.contractid)
12. 107.845 521.735 ↓ 5.6 119,114 1

Merge Left Join (cost=14,535.72..110,595.15 rows=21,246 width=1,234) (actual time=35.840..521.735 rows=119,114 loops=1)

  • Merge Cond: (uc.contractid = not_approver_only_d.contractid)
  • Join Filter: (not_approver_only_d.userid = uc.userid)
13. 15.083 369.227 ↓ 2.4 13,597 1

Merge Left Join (cost=7,590.81..103,264.49 rows=5,742 width=1,251) (actual time=27.915..369.227 rows=13,597 loops=1)

  • Merge Cond: (uc.contractid = contract_roles.contractid)
  • Join Filter: (contract_roles.userid = uc.userid)
14. 6.509 339.609 ↓ 2.7 6,827 1

Merge Left Join (cost=3,163.37..98,720.47 rows=2,526 width=1,237) (actual time=18.620..339.609 rows=6,827 loops=1)

  • Merge Cond: (uc.contractid = dr_query.contractid)
  • Join Filter: (dr_query.userid = uc.userid)
15. 7.773 330.799 ↓ 2.3 5,903 1

Nested Loop Left Join (cost=1,596.25..97,146.05 rows=2,526 width=1,091) (actual time=16.786..330.799 rows=5,903 loops=1)

  • Join Filter: (asa.sequence_id = aseq.id)
  • Rows Removed by Join Filter: 917
16. 9.769 317.123 ↓ 2.3 5,903 1

Nested Loop Left Join (cost=1,596.25..97,107.14 rows=2,526 width=505) (actual time=16.776..317.123 rows=5,903 loops=1)

17. 7.925 289.684 ↓ 2.3 5,890 1

Nested Loop Left Join (cost=1,596.25..96,928.18 rows=2,526 width=481) (actual time=16.760..289.684 rows=5,890 loops=1)

18. 10.287 269.979 ↓ 2.3 5,890 1

Merge Left Join (cost=1,596.10..96,475.71 rows=2,526 width=462) (actual time=16.753..269.979 rows=5,890 loops=1)

  • Merge Cond: (co.id = ea.entityid)
  • Join Filter: (ea.userid = uc.userid)
19. 10.651 244.405 ↓ 2.3 5,890 1

Nested Loop (cost=390.77..95,204.03 rows=2,526 width=406) (actual time=5.856..244.405 rows=5,890 loops=1)

  • Join Filter: (co.id = cn.contractid)
20. 12.407 210.178 ↓ 3.9 5,894 1

Nested Loop (cost=390.34..92,583.91 rows=1,519 width=406) (actual time=5.844..210.178 rows=5,894 loops=1)

  • Join Filter: (uc.party = es.party)
  • Rows Removed by Join Filter: 5,894
21. 5.007 180.089 ↓ 3.9 5,894 1

Merge Left Join (cost=390.06..91,603.25 rows=1,519 width=382) (actual time=5.832..180.089 rows=5,894 loops=1)

  • Merge Cond: (uc.contractid = ad.contractid)
22. 7.221 174.498 ↓ 3.9 5,894 1

Merge Left Join (cost=389.78..91,557.83 rows=1,519 width=350) (actual time=5.823..174.498 rows=5,894 loops=1)

  • Merge Cond: (uc.contractid = udsc.contractid)
23. 11.519 159.759 ↓ 3.9 5,894 1

Nested Loop Left Join (cost=55.02..91,210.58 rows=1,519 width=342) (actual time=0.051..159.759 rows=5,894 loops=1)

24. 15.575 124.664 ↓ 3.9 5,894 1

Nested Loop (cost=54.60..83,220.86 rows=1,519 width=326) (actual time=0.041..124.664 rows=5,894 loops=1)

25. 5.297 91.407 ↓ 3.9 5,894 1

Nested Loop Left Join (cost=54.60..82,711.08 rows=1,519 width=92) (actual time=0.030..91.407 rows=5,894 loops=1)

26. 2.565 2.565 ↑ 1.0 1,519 1

Index Scan using idx_contractsview_contractid_userid on contractsview uc (cost=0.28..150.84 rows=1,519 width=55) (actual time=0.010..2.565 rows=1,519 loops=1)

  • Index Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
27. 7.595 83.545 ↓ 3.0 3 1,519

Subquery Scan on di (cost=54.32..54.34 rows=1 width=53) (actual time=0.050..0.055 rows=3 loops=1,519)

  • Filter: (di.contractid = uc.contractid)
28. 9.114 75.950 ↓ 3.0 3 1,519

HashAggregate (cost=54.32..54.33 rows=1 width=59) (actual time=0.048..0.050 rows=3 loops=1,519)

  • Group Key: dii.id, dii.contractid, dii.queued, dii.cpqueued, dii.status, dii.party, dii.nonstandardterm, uci.party, dii.external
29. 36.367 66.836 ↓ 3.0 3 1,519

Nested Loop (cost=8.37..54.30 rows=1 width=59) (actual time=0.016..0.044 rows=3 loops=1,519)

  • Join Filter: (((uci.documentid = dii.documentid) OR (uci.documentid IS NULL)) AND (((dii.status = ANY ('{REVIEWING,INTERNAL,CLOSED,QUEUED_EXTERNAL}'::text[])) AND (dii.party = uci.party)) OR (dii.status = ANY ('{EXTERNAL,CLOSED}'::text[]))) AND (((NOT dii.external) AND (uci.party = dii.party)) OR (dii.external AND (api_role.priority_to_role((uci.role)::integer) <> 'NegotiationInternalDocumentParticipant'::text)) OR ((api_role.priority_to_role((uci.role)::integer) = 'NegotiationInternalDocumentParticipant'::text) AND (((uci.party = 'PARTY'::text) AND dii.containsinternal) OR ((uci.party = 'COUNTERPARTY'::text) AND dii.cpcontainsinternal)))))
  • Rows Removed by Join Filter: 12
30. 10.633 15.190 ↑ 2.3 3 1,519

Bitmap Heap Scan on discussion dii (cost=4.07..35.72 rows=7 width=71) (actual time=0.006..0.010 rows=3 loops=1,519)

  • Recheck Cond: (contractid = uc.contractid)
  • Filter: ((NOT cancelled) AND ((NOT external) OR external OR containsinternal OR cpcontainsinternal) AND (status <> 'HIDDEN'::text))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=1,995
31. 4.557 4.557 ↑ 2.2 4 1,519

Bitmap Index Scan on di_contractid (cost=0.00..4.07 rows=9 width=0) (actual time=0.003..0.003 rows=4 loops=1,519)

  • Index Cond: (contractid = uc.contractid)
32. 9.583 15.279 ↓ 2.5 5 5,093

Materialize (cost=4.30..10.98 rows=2 width=56) (actual time=0.001..0.003 rows=5 loops=5,093)

33. 3.560 5.696 ↓ 1.5 3 712

Bitmap Heap Scan on documentrolesview uci (cost=4.30..10.97 rows=2 width=56) (actual time=0.006..0.008 rows=3 loops=712)

  • Recheck Cond: ((contractid = uc.contractid) AND (userid = uc.userid))
  • Heap Blocks: exact=1,829
34. 2.136 2.136 ↓ 1.5 3 712

Bitmap Index Scan on idx_documentrolesview_contractid_documentid (cost=0.00..4.30 rows=2 width=0) (actual time=0.003..0.003 rows=3 loops=712)

  • Index Cond: ((contractid = uc.contractid) AND (userid = uc.userid))
35. 17.682 17.682 ↑ 1.0 1 5,894

Index Scan using cp_id on contract co (cost=0.00..0.33 rows=1 width=234) (actual time=0.003..0.003 rows=1 loops=5,894)

  • Index Cond: (id = uc.contractid)
36. 23.576 23.576 ↑ 1.0 1 5,894

Index Scan using idx_contractoles_roles on contractroles ccn (cost=0.42..5.25 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=5,894)

  • Index Cond: ((contractid = co.id) AND (party = 'COUNTERPARTY'::text) AND (role = 'Negotiator'::text))
37. 2.182 7.518 ↓ 9.0 5,202 1

Sort (cost=334.76..336.21 rows=579 width=24) (actual time=5.768..7.518 rows=5,202 loops=1)

  • Sort Key: udsc.contractid
  • Sort Method: quicksort Memory: 91kB
38. 2.704 5.336 ↓ 1.5 850 1

HashAggregate (cost=296.62..302.41 rows=579 width=16) (actual time=5.040..5.336 rows=850 loops=1)

  • Group Key: udsc.contractid
39. 2.632 2.632 ↑ 1.0 5,523 1

Seq Scan on userdiscussions udsc (cost=0.00..269.00 rows=5,523 width=16) (actual time=0.004..2.632 rows=5,523 loops=1)

  • Filter: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Rows Removed by Filter: 5,277
40. 0.584 0.584 ↓ 1.3 446 1

Index Scan using pk_additionaldata on additionaldata ad (cost=0.27..37.49 rows=348 width=48) (actual time=0.007..0.584 rows=446 loops=1)

41. 17.682 17.682 ↑ 1.0 2 5,894

Index Scan using es_entityid_party on entitystatus es (cost=0.29..0.62 rows=2 width=33) (actual time=0.002..0.003 rows=2 loops=5,894)

  • Index Cond: (entityid = co.id)
42. 23.576 23.576 ↑ 2.0 1 5,894

Index Scan using idx_contractoles_roles on contractroles cn (cost=0.42..1.70 rows=2 width=32) (actual time=0.004..0.004 rows=1 loops=5,894)

  • Index Cond: ((contractid = es.entityid) AND (party = 'PARTY'::text) AND (role = 'Negotiator'::text))
43. 9.165 15.287 ↓ 1.6 11,456 1

Sort (cost=1,205.17..1,222.89 rows=7,088 width=88) (actual time=10.884..15.287 rows=11,456 loops=1)

  • Sort Key: ea.entityid
  • Sort Method: quicksort Memory: 1,189kB
44. 6.122 6.122 ↑ 1.0 7,088 1

Seq Scan on entityaccessed ea (cost=0.00..751.85 rows=7,088 width=88) (actual time=0.009..6.122 rows=7,088 loops=1)

  • Filter: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Rows Removed by Filter: 30,740
45. 11.780 11.780 ↑ 1.0 1 5,890

Index Scan using tenant_id on tenant ti (cost=0.14..0.17 rows=1 width=35) (actual time=0.001..0.002 rows=1 loops=5,890)

  • Index Cond: (co.counterpartycompanyid = id)
46. 17.670 17.670 ↑ 1.0 1 5,890

Index Scan using autonumber_sequences_assignment_contract_id_idx on autonumber_sequences_assignment asa (cost=0.00..0.06 rows=1 width=56) (actual time=0.002..0.003 rows=1 loops=5,890)

  • Index Cond: (contract_id = co.id)
  • Filter: (tenant_id = co.tenantid)
47. 5.898 5.903 ↑ 1.0 1 5,903

Materialize (cost=0.00..1.01 rows=1 width=602) (actual time=0.000..0.001 rows=1 loops=5,903)

48. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on autonumber_sequences aseq (cost=0.00..1.01 rows=1 width=602) (actual time=0.003..0.005 rows=1 loops=1)

49. 0.523 2.301 ↓ 21.3 1,301 1

Sort (cost=1,567.12..1,567.27 rows=61 width=178) (actual time=1.831..2.301 rows=1,301 loops=1)

  • Sort Key: dr_query.contractid
  • Sort Method: quicksort Memory: 49kB
50. 0.117 1.778 ↓ 1.5 92 1

Bitmap Heap Scan on documentroles dr_query (cost=1,339.33..1,565.31 rows=61 width=178) (actual time=1.678..1.778 rows=92 loops=1)

  • Recheck Cond: ((userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid) AND (role = ANY ('{Lead,Reviewer,Approver}'::text[])))
  • Filter: (NOT disabled)
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=54
51. 1.661 1.661 ↓ 1.6 95 1

Bitmap Index Scan on documentroles_pk (cost=0.00..1,339.32 rows=61 width=0) (actual time=1.661..1.661 rows=95 loops=1)

  • Index Cond: ((userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid) AND (role = ANY ('{Lead,Reviewer,Approver}'::text[])))
52. 8.349 14.535 ↓ 2.0 15,314 1

Sort (cost=4,427.44..4,446.78 rows=7,733 width=46) (actual time=9.283..14.535 rows=15,314 loops=1)

  • Sort Key: contract_roles.contractid
  • Sort Method: quicksort Memory: 765kB
53. 5.149 6.186 ↑ 1.6 4,736 1

Bitmap Heap Scan on contractroles contract_roles (cost=336.35..3,928.02 rows=7,733 width=46) (actual time=1.169..6.186 rows=4,736 loops=1)

  • Recheck Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Filter: (NOT disabled)
  • Heap Blocks: exact=1,222
54. 1.037 1.037 ↓ 1.4 10,894 1

Bitmap Index Scan on pk_contractroles (cost=0.00..334.42 rows=7,733 width=0) (actual time=1.037..1.037 rows=10,894 loops=1)

  • Index Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
55. 40.307 44.663 ↓ 11.8 121,317 1

Sort (cost=6,944.90..6,970.69 rows=10,316 width=47) (actual time=7.918..44.663 rows=121,317 loops=1)

  • Sort Key: not_approver_only_d.contractid
  • Sort Method: quicksort Memory: 994kB
56. 3.335 4.356 ↑ 1.8 5,719 1

Bitmap Heap Scan on documentroles not_approver_only_d (cost=336.51..6,257.20 rows=10,316 width=47) (actual time=1.090..4.356 rows=5,719 loops=1)

  • Recheck Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Filter: ((NOT disabled) AND (role <> 'Approver'::text))
  • Rows Removed by Filter: 49
  • Heap Blocks: exact=648
57. 1.021 1.021 ↓ 1.5 15,863 1

Bitmap Index Scan on documentroles_userid_contractid (cost=0.00..333.94 rows=10,335 width=0) (actual time=1.021..1.021 rows=15,863 loops=1)

  • Index Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
58. 24.750 102.350 ↓ 2,047.5 83,947 1

Sort (cost=12,332.67..12,332.78 rows=41 width=18) (actual time=77.693..102.350 rows=83,947 loops=1)

  • Sort Key: reviewers_query.contractid
  • Sort Method: quicksort Memory: 39kB
59. 0.107 77.600 ↓ 4.5 183 1

Subquery Scan on reviewers_query (cost=12,330.55..12,331.57 rows=41 width=18) (actual time=77.439..77.600 rows=183 loops=1)

60. 0.565 77.493 ↓ 4.5 183 1

HashAggregate (cost=12,330.55..12,331.16 rows=41 width=49) (actual time=77.437..77.493 rows=183 loops=1)

  • Group Key: dr.contractid, (count(p.id) OVER (?) > 0), (count(a.userid) FILTER (WHERE (NOT a.registered)) OVER (?) > 0)
61. 1.140 76.928 ↓ 3.5 1,081 1

WindowAgg (cost=12,320.54..12,328.24 rows=308 width=49) (actual time=75.505..76.928 rows=1,081 loops=1)

62. 0.865 75.788 ↓ 3.5 1,081 1

Sort (cost=12,320.54..12,321.31 rows=308 width=49) (actual time=75.492..75.788 rows=1,081 loops=1)

  • Sort Key: dr.contractid
  • Sort Method: quicksort Memory: 139kB
63. 6.610 74.923 ↓ 3.5 1,081 1

Hash Right Join (cost=11,747.14..12,307.81 rows=308 width=49) (actual time=63.395..74.923 rows=1,081 loops=1)

  • Hash Cond: ((p.discussionid = dis.id) AND (p.userid = a.userid))
64. 5.023 5.023 ↑ 1.0 15,695 1

Seq Scan on post p (cost=0.00..442.95 rows=15,695 width=48) (actual time=0.005..5.023 rows=15,695 loops=1)

65. 0.599 63.290 ↓ 3.4 1,050 1

Hash (cost=11,742.52..11,742.52 rows=308 width=49) (actual time=63.290..63.290 rows=1,050 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 97kB
66. 0.722 62.691 ↓ 3.4 1,050 1

Nested Loop Left Join (cost=11,349.72..11,742.52 rows=308 width=49) (actual time=59.642..62.691 rows=1,050 loops=1)

67. 0.586 60.561 ↓ 1.8 352 1

Merge Join (cost=11,349.72..11,355.89 rows=192 width=49) (actual time=59.628..60.561 rows=352 loops=1)

  • Merge Cond: (dr.userid = a.userid)
68. 0.342 59.043 ↓ 1.8 352 1

Sort (cost=11,296.08..11,296.56 rows=192 width=48) (actual time=58.946..59.043 rows=352 loops=1)

  • Sort Key: dr.userid
  • Sort Method: quicksort Memory: 52kB
69. 0.787 58.701 ↓ 1.8 352 1

Hash Join (cost=844.84..11,288.80 rows=192 width=48) (actual time=2.406..58.701 rows=352 loops=1)

  • Hash Cond: (dr.documentid = d.id)
70. 55.583 55.583 ↓ 1.1 1,485 1

Seq Scan on documentroles dr (cost=0.00..10,436.88 rows=1,378 width=48) (actual time=0.065..55.583 rows=1,485 loops=1)

  • Filter: (role = 'Reviewer'::text)
  • Rows Removed by Filter: 370,923
71. 0.338 2.331 ↑ 1.0 859 1

Hash (cost=834.10..834.10 rows=859 width=16) (actual time=2.331..2.331 rows=859 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 49kB
72. 1.993 1.993 ↑ 1.0 859 1

Seq Scan on documents d (cost=0.00..834.10 rows=859 width=16) (actual time=0.005..1.993 rows=859 loops=1)

  • Filter: (status = 'REVIEWING'::text)
  • Rows Removed by Filter: 5,309
73. 0.642 0.932 ↓ 1.4 946 1

Sort (cost=53.64..55.29 rows=662 width=17) (actual time=0.667..0.932 rows=946 loops=1)

  • Sort Key: a.userid
  • Sort Method: quicksort Memory: 76kB
74. 0.290 0.290 ↑ 1.0 662 1

Seq Scan on account a (cost=0.00..22.62 rows=662 width=17) (actual time=0.004..0.290 rows=662 loops=1)

75. 1.408 1.408 ↑ 3.0 2 352

Index Scan using di_documentid on discussion dis (cost=0.00..1.95 rows=6 width=32) (actual time=0.002..0.004 rows=2 loops=352)

  • Index Cond: (d.id = documentid)
76. 0.088 0.165 ↑ 4.9 219 1

Hash (cost=20.70..20.70 rows=1,070 width=48) (actual time=0.165..0.165 rows=219 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 28kB
77. 0.077 0.077 ↑ 4.9 219 1

Seq Scan on approval_state a_state (cost=0.00..20.70 rows=1,070 width=48) (actual time=0.010..0.077 rows=219 loops=1)

78. 0.013 0.052 ↓ 5.8 23 1

Hash (cost=12.77..12.77 rows=4 width=18) (actual time=0.052..0.052 rows=23 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
79. 0.028 0.039 ↓ 5.8 23 1

Bitmap Heap Scan on approval_approver a_approver (cost=4.31..12.77 rows=4 width=18) (actual time=0.029..0.039 rows=23 loops=1)

  • Recheck Cond: ('cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid = user_id)
  • Heap Blocks: exact=2
80. 0.011 0.011 ↓ 11.5 46 1

Bitmap Index Scan on approval_approver_pkey (cost=0.00..4.31 rows=4 width=0) (actual time=0.011..0.011 rows=46 loops=1)

  • Index Cond: ('cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid = user_id)
Planning time : 10.975 ms
Execution time : 40,031.637 ms