explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6imP

Settings
# exclusive inclusive rows x rows loops node
1. 3.614 76,501.839 ↑ 16.6 1,518 1

Unique (cost=159,236.66..163,212.28 rows=25,242 width=1,208) (actual time=76,497.517..76,501.839 rows=1,518 loops=1)

2. 19.108 76,498.225 ↑ 9.7 2,591 1

Sort (cost=159,236.66..159,299.77 rows=25,242 width=1,208) (actual time=76,497.514..76,498.225 rows=2,591 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: 1980kB
3. 5,605.339 76,479.117 ↑ 9.7 2,591 1

GroupAggregate (cost=140,252.12..144,101.53 rows=25,242 width=1,208) (actual time=62,511.888..76,479.117 rows=2,591 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, docs.id
  • Filter: ((uc.party = 'PARTY'::text) OR (count(CASE WHEN docs.shared THEN 1 ELSE NULL::integer END) > 0))
4. 58,983.129 70,873.778 ↓ 121.2 3,059,183 1

Sort (cost=140,252.12..140,315.23 rows=25,242 width=1,208) (actual time=62,511.829..70,873.778 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, docs.id
  • Sort Method: external merge Disk: 1957800kB
5. 2,942.312 11,890.649 ↓ 121.2 3,059,183 1

Hash Left Join (cost=28,185.68..125,116.98 rows=25,242 width=1,208) (actual time=193.780..11,890.649 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,416.091 8,948.278 ↓ 121.2 3,059,183 1

Hash Left Join (cost=28,172.58..124,722.89 rows=25,242 width=1,260) (actual time=193.709..8,948.278 rows=3,059,183 loops=1)

  • Hash Cond: (dr_query.documentid = a_state.document_id)
7. 3,516.835 6,532.033 ↓ 121.2 3,059,183 1

Merge Right Join (cost=28,165.65..124,611.25 rows=25,242 width=1,253) (actual time=193.544..6,532.033 rows=3,059,183 loops=1)

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

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

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

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

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

Materialize (cost=27,057.28..123,152.26 rows=20,242 width=1,236) (actual time=186.770..3,006.380 rows=3,059,181 loops=1)

11. 121.920 822.138 ↓ 5.9 119,114 1

Merge Left Join (cost=27,057.28..123,101.65 rows=20,242 width=1,236) (actual time=186.764..822.138 rows=119,114 loops=1)

  • Merge Cond: (co.id = reviewers_query.contractid)
12. 108.066 522.539 ↓ 5.9 119,114 1

Merge Left Join (cost=14,594.70..110,584.02 rows=20,242 width=1,234) (actual time=33.695..522.539 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.338 370.100 ↓ 2.5 13,597 1

Merge Left Join (cost=7,646.87..103,268.77 rows=5,432 width=1,251) (actual time=25.739..370.100 rows=13,597 loops=1)

  • Merge Cond: (uc.contractid = contract_roles.contractid)
  • Join Filter: (contract_roles.userid = uc.userid)
14. 6.273 342.559 ↓ 2.9 6,827 1

Merge Left Join (cost=3,205.36..98,714.45 rows=2,355 width=1,237) (actual time=18.842..342.559 rows=6,827 loops=1)

  • Merge Cond: (uc.contractid = dr_query.contractid)
  • Join Filter: (dr_query.userid = uc.userid)
15. 8.112 333.963 ↓ 2.5 5,903 1

Nested Loop Left Join (cost=1,594.61..97,096.74 rows=2,355 width=1,091) (actual time=16.976..333.963 rows=5,903 loops=1)

  • Join Filter: (asa.sequence_id = aseq.id)
  • Rows Removed by Join Filter: 917
16. 10.275 319.948 ↓ 2.5 5,903 1

Nested Loop Left Join (cost=1,594.61..97,060.41 rows=2,355 width=505) (actual time=16.967..319.948 rows=5,903 loops=1)

17. 7.870 292.003 ↓ 2.5 5,890 1

Nested Loop Left Join (cost=1,594.61..96,893.55 rows=2,355 width=481) (actual time=16.951..292.003 rows=5,890 loops=1)

18. 10.200 272.353 ↓ 2.5 5,890 1

Merge Left Join (cost=1,594.47..96,471.72 rows=2,355 width=462) (actual time=16.944..272.353 rows=5,890 loops=1)

  • Merge Cond: (co.id = ea.entityid)
  • Join Filter: (ea.userid = uc.userid)
19. 11.013 246.485 ↓ 2.5 5,890 1

Nested Loop (cost=390.77..95,204.03 rows=2,355 width=406) (actual time=5.799..246.485 rows=5,890 loops=1)

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

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

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

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

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

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

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

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

24. 14.929 125.942 ↓ 3.9 5,894 1

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

25. 5.731 93.331 ↓ 3.9 5,894 1

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

26. 2.536 2.536 ↑ 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.536 rows=1,519 loops=1)

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

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

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

HashAggregate (cost=54.32..54.33 rows=1 width=59) (actual time=0.049..0.051 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. 37.886 68.355 ↓ 3.0 3 1,519

Nested Loop (cost=8.37..54.30 rows=1 width=59) (actual time=0.016..0.045 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. 9.114 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=1995
31. 6.076 6.076 ↑ 2.2 4 1,519

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

  • Index Cond: (contractid = uc.contractid)
32. 8.871 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. 4.272 6.408 ↓ 1.5 3 712

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

  • Recheck Cond: ((contractid = uc.contractid) AND (userid = uc.userid))
  • Heap Blocks: exact=1829
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.248 7.499 ↓ 9.0 5,202 1

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

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

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

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

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

  • Filter: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Rows Removed by Filter: 5277
40. 0.631 0.631 ↓ 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.631 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.629 15.668 ↓ 1.6 11,456 1

Sort (cost=1,203.53..1,221.19 rows=7,065 width=88) (actual time=11.133..15.668 rows=11,456 loops=1)

  • Sort Key: ea.entityid
  • Sort Method: quicksort Memory: 1189kB
44. 6.039 6.039 ↓ 1.0 7,088 1

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

  • Filter: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Rows Removed by Filter: 30740
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.899 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.004 0.004 ↑ 1.0 1 1

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

49. 0.510 2.323 ↓ 18.9 1,301 1

Sort (cost=1,610.75..1,610.92 rows=69 width=178) (actual time=1.863..2.323 rows=1,301 loops=1)

  • Sort Key: dr_query.contractid
  • Sort Method: quicksort Memory: 49kB
50. 0.130 1.813 ↓ 1.3 92 1

Bitmap Heap Scan on documentroles dr_query (cost=1,354.39..1,608.64 rows=69 width=178) (actual time=1.703..1.813 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.683 1.683 ↓ 1.4 95 1

Bitmap Index Scan on documentroles_pk (cost=0.00..1,354.38 rows=69 width=0) (actual time=1.683..1.683 rows=95 loops=1)

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

Sort (cost=4,441.50..4,461.11 rows=7,842 width=46) (actual time=6.886..12.203 rows=15,314 loops=1)

  • Sort Key: contract_roles.contractid
  • Sort Method: quicksort Memory: 765kB
53. 3.176 3.896 ↑ 1.7 4,736 1

Bitmap Heap Scan on contractroles contract_roles (cost=341.21..3,934.24 rows=7,842 width=46) (actual time=0.838..3.896 rows=4,736 loops=1)

  • Recheck Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Filter: (NOT disabled)
  • Heap Blocks: exact=1117
54. 0.720 0.720 ↓ 1.0 8,088 1

Bitmap Index Scan on pk_contractroles (cost=0.00..339.25 rows=7,843 width=0) (actual time=0.720..0.720 rows=8,088 loops=1)

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

Sort (cost=6,947.82..6,973.88 rows=10,423 width=47) (actual time=7.948..44.373 rows=121,317 loops=1)

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

Bitmap Heap Scan on documentroles not_approver_only_d (cost=341.31..6,252.22 rows=10,423 width=47) (actual time=1.030..4.254 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. 0.956 0.956 ↓ 1.5 15,863 1

Bitmap Index Scan on documentroles_userid_contractid (cost=0.00..338.70 rows=10,437 width=0) (actual time=0.956..0.956 rows=15,863 loops=1)

  • Index Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
58. 24.709 177.679 ↓ 1,583.9 83,947 1

Sort (cost=12,462.58..12,462.72 rows=53 width=18) (actual time=153.065..177.679 rows=83,947 loops=1)

  • Sort Key: reviewers_query.contractid
  • Sort Method: quicksort Memory: 39kB
59. 0.103 152.970 ↓ 3.5 183 1

Subquery Scan on reviewers_query (cost=12,459.74..12,461.07 rows=53 width=18) (actual time=152.805..152.970 rows=183 loops=1)

60. 0.570 152.867 ↓ 3.5 183 1

HashAggregate (cost=12,459.74..12,460.54 rows=53 width=49) (actual time=152.804..152.867 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.154 152.297 ↓ 2.7 1,081 1

WindowAgg (cost=12,446.77..12,456.75 rows=399 width=49) (actual time=150.852..152.297 rows=1,081 loops=1)

62. 0.864 151.143 ↓ 2.7 1,081 1

Sort (cost=12,446.77..12,447.77 rows=399 width=49) (actual time=150.835..151.143 rows=1,081 loops=1)

  • Sort Key: dr.contractid
  • Sort Method: quicksort Memory: 139kB
63. 6.558 150.279 ↓ 2.7 1,081 1

Hash Right Join (cost=11,868.86..12,429.54 rows=399 width=49) (actual time=138.933..150.279 rows=1,081 loops=1)

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

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

65. 0.549 138.797 ↓ 2.6 1,050 1

Hash (cost=11,862.88..11,862.88 rows=399 width=49) (actual time=138.797..138.797 rows=1,050 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 97kB
66. 0.727 138.248 ↓ 2.6 1,050 1

Nested Loop Left Join (cost=11,354.46..11,862.88 rows=399 width=49) (actual time=135.206..138.248 rows=1,050 loops=1)

67. 0.564 136.113 ↓ 1.4 352 1

Merge Join (cost=11,354.46..11,361.48 rows=249 width=49) (actual time=135.193..136.113 rows=352 loops=1)

  • Merge Cond: (dr.userid = a.userid)
68. 0.385 134.613 ↓ 1.4 352 1

Sort (cost=11,300.81..11,301.43 rows=249 width=48) (actual time=134.515..134.613 rows=352 loops=1)

  • Sort Key: dr.userid
  • Sort Method: quicksort Memory: 52kB
69. 0.907 134.228 ↓ 1.4 352 1

Hash Join (cost=844.84..11,290.90 rows=249 width=48) (actual time=3.065..134.228 rows=352 loops=1)

  • Hash Cond: (dr.documentid = d.id)
70. 130.938 130.938 ↑ 1.2 1,485 1

Seq Scan on documentroles dr (cost=0.00..10,436.88 rows=1,786 width=48) (actual time=0.668..130.938 rows=1,485 loops=1)

  • Filter: (role = 'Reviewer'::text)
  • Rows Removed by Filter: 370923
71. 0.373 2.383 ↑ 1.0 859 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 49kB
72. 2.010 2.010 ↑ 1.0 859 1

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

  • Filter: (status = 'REVIEWING'::text)
  • Rows Removed by Filter: 5309
73. 0.659 0.936 ↓ 1.4 946 1

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

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

Seq Scan on account a (cost=0.00..22.62 rows=662 width=17) (actual time=0.004..0.277 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.085 0.154 ↑ 1.0 219 1

Hash (cost=4.19..4.19 rows=219 width=23) (actual time=0.154..0.154 rows=219 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
77. 0.069 0.069 ↑ 1.0 219 1

Seq Scan on approval_state a_state (cost=0.00..4.19 rows=219 width=23) (actual time=0.006..0.069 rows=219 loops=1)

78. 0.011 0.059 ↑ 1.0 23 1

Hash (cost=12.81..12.81 rows=23 width=18) (actual time=0.059..0.059 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
79. 0.048 0.048 ↑ 1.0 23 1

Seq Scan on approval_approver a_approver (cost=0.00..12.81 rows=23 width=18) (actual time=0.034..0.048 rows=23 loops=1)

  • Filter: ('cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid = user_id)
  • Rows Removed by Filter: 362
Planning time : 11.968 ms
Execution time : 76,737.914 ms