explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MAPN : Optimization for: plan #NaiTB

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.446 34,800.298 ↓ 4.8 3,994 1

Unique (cost=421,687.10..421,817.30 rows=840 width=1,217) (actual time=34,797.569..34,800.298 rows=3,994 loops=1)

2. 5.050 34,797.852 ↓ 4.8 3,994 1

Sort (cost=421,687.10..421,689.20 rows=840 width=1,217) (actual time=34,797.568..34,797.852 rows=3,994 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 OR (pr.nonstandardterm IS TRUE))) > 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 - CURRENT_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)), ((count(*) FILTER (WHERE (docs_status.status <> ALL ('{SIGNED,NSIGNED,CANCELLED,NCANCELLED}'::text[]))) > 0)), ((count(*) FILTER (WHERE ((da.* IS NULL) AND (dr_query.role = 'Approver'::text) AND (docs_status.status = ANY ('{APPROVING,APPROVED,NAPPROVING,NAPPROVED}'::text[])))) > 0)), ((count(*) FILTER (WHERE ((dr_query.role = 'Reviewer'::text) AND (docs_status.status = ANY ('{REVIEWING,NEGOTIATING}'::text[])))) > 0)), reviewers_query.has_posts_by_reviwer, reviewers_query.has_not_registred_reviewers, ((count(*) FILTER (WHERE (dr_query.role = 'Lead'::text)) > 0)), ad.post_execution_saved_by_user, (COALESCE(bool_or(dr_query.my_turn), false))
  • Sort Method: quicksort Memory: 2,117kB
3. 481.719 34,792.802 ↓ 4.8 3,994 1

GroupAggregate (cost=421,501.40..421,646.30 rows=840 width=1,217) (actual time=34,056.118..34,792.802 rows=3,994 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, ad.post_execution_saved_by_user
  • Filter: ((uc.party = 'PARTY'::text) OR (count(CASE WHEN (docs.shared AND (NOT docs.cancelled) AND (NOT docs.removed)) THEN 1 ELSE NULL::integer END) > 0))
4. 891.293 34,311.083 ↓ 263.7 221,473 1

Sort (cost=421,501.40..421,503.50 rows=840 width=1,408) (actual time=34,056.058..34,311.083 rows=221,473 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, ad.post_execution_saved_by_user
  • Sort Method: external merge Disk: 119,256kB
5. 245.074 33,419.790 ↓ 263.7 221,473 1

Nested Loop Left Join (cost=252,754.15..421,460.60 rows=840 width=1,408) (actual time=180.741..33,419.790 rows=221,473 loops=1)

6. 110.510 32,731.770 ↓ 263.7 221,473 1

Hash Left Join (cost=252,753.74..420,584.99 rows=840 width=1,392) (actual time=180.717..32,731.770 rows=221,473 loops=1)

  • Hash Cond: (co.id = reviewers_query.contractid)
7. 96.462 32,484.159 ↓ 263.7 221,473 1

Hash Left Join (cost=227,625.11..395,453.18 rows=840 width=1,390) (actual time=43.606..32,484.159 rows=221,473 loops=1)

  • Hash Cond: (docs.id = pr.documentid)
8. 89.136 32,387.676 ↓ 263.7 221,473 1

Nested Loop Left Join (cost=2,783.08..170,608.94 rows=840 width=1,389) (actual time=43.574..32,387.676 rows=221,473 loops=1)

9. 217.947 32,093.965 ↓ 76.7 29,225 1

Nested Loop Left Join (cost=2,782.80..168,588.86 rows=381 width=1,370) (actual time=43.557..32,093.965 rows=29,225 loops=1)

  • Join Filter: ((dr_query.userid = da.userid) AND (dr_query.documentid = da.documentid))
  • Rows Removed by Join Filter: 1,601,035
10. 358.655 31,788.343 ↓ 76.7 29,225 1

Nested Loop Left Join (cost=2,782.80..168,542.93 rows=381 width=1,297) (actual time=43.370..31,788.343 rows=29,225 loops=1)

  • Join Filter: ((dr_query.userid = uc.userid) AND (dr_query.contractid = uc.contractid))
  • Rows Removed by Join Filter: 2,366,962
11. 8.605 31,273.313 ↓ 45.6 17,375 1

Nested Loop Left Join (cost=2,782.37..163,924.63 rows=381 width=1,281) (actual time=37.591..31,273.313 rows=17,375 loops=1)

12. 15.865 31,229.958 ↓ 45.6 17,375 1

Nested Loop Left Join (cost=2,782.10..163,807.13 rows=381 width=1,249) (actual time=37.583..31,229.958 rows=17,375 loops=1)

  • Join Filter: (ea.userid = uc.userid)
13. 21.039 31,161.968 ↓ 45.6 17,375 1

Merge Left Join (cost=2,781.68..163,268.42 rows=381 width=1,193) (actual time=37.562..31,161.968 rows=17,375 loops=1)

  • Merge Cond: (co.id = asa.contract_id)
  • Join Filter: (asa.tenant_id = co.tenantid)
14. 21.197 31,135.927 ↓ 45.5 17,340 1

Nested Loop (cost=2,514.04..162,980.20 rows=381 width=583) (actual time=34.995..31,135.927 rows=17,340 loops=1)

  • Join Filter: (co.id = cn.contractid)
15. 14.630 31,045.370 ↓ 118.8 17,340 1

Nested Loop Left Join (cost=2,513.62..162,613.81 rows=146 width=583) (actual time=34.965..31,045.370 rows=17,340 loops=1)

16. 21.328 30,961.380 ↓ 118.8 17,340 1

Nested Loop (cost=2,513.20..161,629.59 rows=146 width=567) (actual time=34.950..30,961.380 rows=17,340 loops=1)

  • Join Filter: (((uc.party = 'PARTY'::text) OR (NOT co.hybrid)) AND (uc.contractid = co.id))
17. 12.066 30,888.032 ↓ 145.7 17,340 1

Nested Loop Left Join (cost=2,512.92..161,588.43 rows=119 width=228) (actual time=34.927..30,888.032 rows=17,340 loops=1)

18. 5.385 34.298 ↓ 33.6 3,994 1

Merge Left Join (cost=1,164.88..1,166.02 rows=119 width=144) (actual time=26.348..34.298 rows=3,994 loops=1)

  • Merge Cond: (uc.contractid = udsc.contractid)
19. 4.412 21.422 ↓ 33.6 3,994 1

Sort (cost=880.06..880.35 rows=119 width=136) (actual time=19.493..21.422 rows=3,994 loops=1)

  • Sort Key: uc.contractid
  • Sort Method: quicksort Memory: 663kB
20. 1.296 17.010 ↓ 33.6 3,994 1

Hash Left Join (cost=174.76..875.95 rows=119 width=136) (actual time=2.350..17.010 rows=3,994 loops=1)

  • Hash Cond: (uc.contractid = ad.contractid)
21. 9.613 15.430 ↓ 33.6 3,994 1

Hash Join (cost=152.84..853.72 rows=119 width=103) (actual time=2.061..15.430 rows=3,994 loops=1)

  • Hash Cond: ((es.entityid = uc.contractid) AND (es.party = uc.party))
  • Join Filter: ((uc.party = 'PARTY'::text) OR (es.status = ANY ('{NEGOTIATING,NAPPROVING,NAPPROVED,EXECUTED,NSIGNING,NSIGNED}'::text[])))
22. 3.791 3.791 ↓ 1.5 35,528 1

Seq Scan on entitystatus es (cost=0.00..576.30 rows=23,730 width=80) (actual time=0.005..3.791 rows=35,528 loops=1)

23. 1.185 2.026 ↑ 1.0 3,994 1

Hash (cost=92.93..92.93 rows=3,994 width=55) (actual time=2.026..2.026 rows=3,994 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 372kB
24. 0.841 0.841 ↑ 1.0 3,994 1

Seq Scan on contractsview uc (cost=0.00..92.93 rows=3,994 width=55) (actual time=0.006..0.841 rows=3,994 loops=1)

  • Filter: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
25. 0.131 0.284 ↓ 1.1 587 1

Hash (cost=15.30..15.30 rows=530 width=49) (actual time=0.284..0.284 rows=587 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 46kB
26. 0.153 0.153 ↓ 1.1 587 1

Seq Scan on additionaldata ad (cost=0.00..15.30 rows=530 width=49) (actual time=0.008..0.153 rows=587 loops=1)

27. 0.949 7.491 ↓ 11.1 1,154 1

Sort (cost=284.82..285.08 rows=104 width=24) (actual time=6.848..7.491 rows=1,154 loops=1)

  • Sort Key: udsc.contractid
  • Sort Method: quicksort Memory: 139kB
28. 3.123 6.542 ↓ 11.1 1,154 1

HashAggregate (cost=279.25..280.29 rows=104 width=24) (actual time=6.351..6.542 rows=1,154 loops=1)

  • Group Key: udsc.contractid
29. 2.429 3.419 ↓ 78.1 11,483 1

Bitmap Heap Scan on viewed_user_discussions udsc (cost=9.55..278.52 rows=147 width=16) (actual time=1.037..3.419 rows=11,483 loops=1)

  • Recheck Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Heap Blocks: exact=315
30. 0.990 0.990 ↓ 78.1 11,483 1

Bitmap Index Scan on pk_userdiscussions (cost=0.00..9.51 rows=147 width=0) (actual time=0.990..0.990 rows=11,483 loops=1)

  • Index Cond: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
31. 3.994 30,841.668 ↓ 4.0 4 3,994

Subquery Scan on di (cost=1,348.04..1,348.08 rows=1 width=100) (actual time=7.718..7.722 rows=4 loops=3,994)

  • Filter: (di.contractid = uc.contractid)
32. 15.976 30,837.674 ↓ 4.0 4 3,994

Unique (cost=1,348.04..1,348.07 rows=1 width=106) (actual time=7.718..7.721 rows=4 loops=3,994)

33. 39.940 30,821.698 ↓ 4.0 4 3,994

Sort (cost=1,348.04..1,348.05 rows=1 width=106) (actual time=7.716..7.717 rows=4 loops=3,994)

  • Sort Key: dii.id, dii.queued, dii.cpqueued, dii.status, dii.party, dii.nonstandardterm, uci.party, dii.external
  • Sort Method: quicksort Memory: 25kB
34. 103.054 30,781.758 ↓ 4.0 4 3,994

Nested Loop (cost=0.28..1,348.03 rows=1 width=106) (actual time=5.682..7.707 rows=4 loops=3,994)

  • 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: 16
35. 30,633.980 30,633.980 ↓ 4.0 4 3,994

Seq Scan on discussion dii (cost=0.00..1,336.88 rows=1 width=118) (actual time=5.667..7.670 rows=4 loops=3,994)

  • Filter: ((NOT cancelled) AND (status <> 'HIDDEN'::text) AND (contractid = uc.contractid) AND ((status = ANY ('{REVIEWING,INTERNAL,CLOSED,QUEUED_EXTERNAL}'::text[])) OR (status = ANY ('{EXTERNAL,CLOSED}'::text[]))))
  • Rows Removed by Filter: 25,589
36. 44.724 44.724 ↓ 2.5 5 14,908

Index Scan using documentrolesview_contractid_documentid_userid_idx on documentrolesview uci (cost=0.28..10.07 rows=2 width=56) (actual time=0.002..0.003 rows=5 loops=14,908)

  • Index Cond: ((contractid = uc.contractid) AND (userid = uc.userid))
37. 52.020 52.020 ↑ 1.0 1 17,340

Index Scan using pk_contract on contract co (cost=0.28..0.33 rows=1 width=339) (actual time=0.003..0.003 rows=1 loops=17,340)

  • Index Cond: (id = es.entityid)
38. 69.360 69.360 ↑ 1.0 1 17,340

Index Scan using contractroles_party_role on contractroles ccn (cost=0.42..6.73 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=17,340)

  • Index Cond: ((contractid = co.id) AND (party = 'COUNTERPARTY'::text) AND (role = 'Negotiator'::text))
39. 69.360 69.360 ↑ 2.0 1 17,340

Index Scan using contractroles_party_role on contractroles cn (cost=0.42..2.48 rows=2 width=32) (actual time=0.004..0.004 rows=1 loops=17,340)

  • Index Cond: ((contractid = es.entityid) AND (party = 'PARTY'::text) AND (role = 'Negotiator'::text))
40. 3.552 5.002 ↓ 5.0 15,143 1

Sort (cost=267.64..275.23 rows=3,034 width=642) (actual time=2.558..5.002 rows=15,143 loops=1)

  • Sort Key: asa.contract_id
  • Sort Method: quicksort Memory: 800kB
41. 1.169 1.450 ↑ 1.1 2,650 1

Hash Left Join (cost=12.70..92.17 rows=3,034 width=642) (actual time=0.022..1.450 rows=2,650 loops=1)

  • Hash Cond: (asa.sequence_id = aseq.id)
42. 0.275 0.275 ↑ 1.1 2,650 1

Seq Scan on autonumber_sequences_assignment asa (cost=0.00..71.34 rows=3,034 width=56) (actual time=0.006..0.275 rows=2,650 loops=1)

43. 0.002 0.006 ↑ 120.0 1 1

Hash (cost=11.20..11.20 rows=120 width=602) (actual time=0.006..0.006 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
44. 0.004 0.004 ↑ 120.0 1 1

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

45. 52.125 52.125 ↑ 1.0 1 17,375

Index Scan using uca_contractid_userid on entityaccessed ea (cost=0.41..1.40 rows=1 width=88) (actual time=0.003..0.003 rows=1 loops=17,375)

  • Index Cond: ((entityid = co.id) AND (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid))
46. 34.750 34.750 ↑ 1.0 1 17,375

Index Scan using tenant_pkey on tenant ti (cost=0.27..0.31 rows=1 width=48) (actual time=0.002..0.002 rows=1 loops=17,375)

  • Index Cond: (id = co.counterpartycompanyid)
47. 150.698 156.375 ↓ 1.2 137 17,375

Materialize (cost=0.42..3,865.16 rows=113 width=64) (actual time=0.000..0.009 rows=137 loops=17,375)

48. 5.677 5.677 ↓ 1.2 137 1

Index Scan using documentroles_pk on documentroles dr_query (cost=0.42..3,864.60 rows=113 width=64) (actual time=0.115..5.677 rows=137 loops=1)

  • Index Cond: ((userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid) AND (role = ANY ('{Lead,Reviewer,Approver}'::text[])))
  • Filter: (NOT disabled)
  • Rows Removed by Filter: 3
49. 87.524 87.675 ↓ 13.8 55 29,225

Materialize (cost=0.00..19.27 rows=4 width=137) (actual time=0.000..0.003 rows=55 loops=29,225)

50. 0.151 0.151 ↓ 13.8 55 1

Seq Scan on documentapprove da (cost=0.00..19.25 rows=4 width=137) (actual time=0.012..0.151 rows=55 loops=1)

  • Filter: (userid = 'cd9a210b-1779-480e-9990-65e846e4d4e9'::uuid)
  • Rows Removed by Filter: 319
51. 204.575 204.575 ↑ 4.5 8 29,225

Index Scan using documents_contract_id_idx on documents docs (cost=0.29..4.94 rows=36 width=35) (actual time=0.002..0.007 rows=8 loops=29,225)

  • Index Cond: (contractid = co.id)
  • Filter: ((NOT cancelled) AND (NOT removed))
  • Rows Removed by Filter: 1
52. 0.002 0.021 ↑ 200.0 1 1

Hash (cost=224,839.53..224,839.53 rows=200 width=17) (actual time=0.021..0.021 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
53. 0.001 0.019 ↑ 200.0 1 1

Subquery Scan on pr (cost=224,836.03..224,839.53 rows=200 width=17) (actual time=0.018..0.019 rows=1 loops=1)

54. 0.001 0.018 ↑ 200.0 1 1

Unique (cost=224,836.03..224,837.53 rows=200 width=17) (actual time=0.017..0.018 rows=1 loops=1)

55. 0.006 0.017 ↑ 200.0 1 1

Sort (cost=224,836.03..224,836.53 rows=200 width=17) (actual time=0.017..0.017 rows=1 loops=1)

  • Sort Key: pr_1.documentid, ((count(pr_1.documentid) > 0))
  • Sort Method: quicksort Memory: 25kB
56. 0.006 0.011 ↑ 200.0 1 1

HashAggregate (cost=224,825.88..224,828.38 rows=200 width=17) (actual time=0.010..0.011 rows=1 loops=1)

  • Group Key: pr_1.documentid
57. 0.003 0.005 ↑ 1,865,496.0 1 1

Bitmap Heap Scan on paragraph pr_1 (cost=475.44..215,498.40 rows=1,865,496 width=16) (actual time=0.004..0.005 rows=1 loops=1)

  • Recheck Cond: (nonstandardterm IS TRUE)
  • Heap Blocks: exact=1
58. 0.002 0.002 ↑ 1,865,496.0 1 1

Bitmap Index Scan on non_st_index (cost=0.00..9.07 rows=1,865,496 width=0) (actual time=0.002..0.002 rows=1 loops=1)

59. 0.067 137.101 ↓ 23.6 331 1

Hash (cost=25,128.45..25,128.45 rows=14 width=18) (actual time=137.101..137.101 rows=331 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
60. 0.059 137.034 ↓ 23.6 331 1

Subquery Scan on reviewers_query (cost=25,128.17..25,128.45 rows=14 width=18) (actual time=136.382..137.034 rows=331 loops=1)

61. 0.430 136.975 ↓ 23.6 331 1

Unique (cost=25,128.17..25,128.31 rows=14 width=18) (actual time=136.381..136.975 rows=331 loops=1)

62. 0.619 136.545 ↓ 172.1 2,410 1

Sort (cost=25,128.17..25,128.21 rows=14 width=18) (actual time=136.380..136.545 rows=2,410 loops=1)

  • Sort Key: dr.contractid, ((count(p.id) OVER (?) > 0)), ((count(a.userid) FILTER (WHERE (NOT a.registered)) OVER (?) > 0))
  • Sort Method: quicksort Memory: 285kB
63. 1.530 135.926 ↓ 172.1 2,410 1

WindowAgg (cost=25,127.55..25,127.90 rows=14 width=18) (actual time=134.257..135.926 rows=2,410 loops=1)

64. 0.981 134.396 ↓ 172.1 2,410 1

Sort (cost=25,127.55..25,127.59 rows=14 width=49) (actual time=134.245..134.396 rows=2,410 loops=1)

  • Sort Key: dr.contractid
  • Sort Method: quicksort Memory: 295kB
65. 1.027 133.415 ↓ 172.1 2,410 1

Hash Left Join (cost=4,396.34..25,127.29 rows=14 width=49) (actual time=31.741..133.415 rows=2,410 loops=1)

  • Hash Cond: ((dis.id = p.discussionid) AND (a.userid = p.userid))
66. 1.983 115.411 ↓ 169.6 2,374 1

Nested Loop (cost=3,221.47..23,889.05 rows=14 width=49) (actual time=14.728..115.411 rows=2,374 loops=1)

67. 1.257 111.054 ↓ 169.6 2,374 1

Hash Join (cost=3,221.19..23,884.10 rows=14 width=48) (actual time=14.716..111.054 rows=2,374 loops=1)

  • Hash Cond: (dr.documentid = d.id)
68. 95.093 95.093 ↑ 1.0 2,633 1

Seq Scan on documentroles dr (cost=0.00..20,652.46 rows=2,749 width=48) (actual time=0.004..95.093 rows=2,633 loops=1)

  • Filter: (role = 'Reviewer'::text)
  • Rows Removed by Filter: 708,364
69. 0.710 14.704 ↓ 27.0 3,860 1

Hash (cost=3,219.40..3,219.40 rows=143 width=32) (actual time=14.704..14.704 rows=3,860 loops=1)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 263kB
70. 3.422 13.994 ↓ 27.0 3,860 1

Hash Right Join (cost=2,044.85..3,219.40 rows=143 width=32) (actual time=3.824..13.994 rows=3,860 loops=1)

  • Hash Cond: (dis.documentid = d.id)
71. 6.763 6.763 ↓ 1.6 25,593 1

Seq Scan on discussion dis (cost=0.00..1,131.39 rows=16,439 width=32) (actual time=0.008..6.763 rows=25,593 loops=1)

72. 0.262 3.809 ↓ 10.0 1,428 1

Hash (cost=2,043.06..2,043.06 rows=143 width=16) (actual time=3.809..3.809 rows=1,428 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 83kB
73. 3.547 3.547 ↓ 10.0 1,428 1

Seq Scan on documents d (cost=0.00..2,043.06 rows=143 width=16) (actual time=0.004..3.547 rows=1,428 loops=1)

  • Filter: (status = 'REVIEWING'::text)
  • Rows Removed by Filter: 8,698
74. 2.374 2.374 ↑ 1.0 1 2,374

Index Scan using ac_userid on account a (cost=0.28..0.35 rows=1 width=17) (actual time=0.001..0.001 rows=1 loops=2,374)

  • Index Cond: (userid = dr.userid)
75. 9.588 16.977 ↓ 2.0 37,001 1

Hash (cost=903.75..903.75 rows=18,075 width=48) (actual time=16.977..16.977 rows=37,001 loops=1)

  • Buckets: 65,536 (originally 32768) Batches: 1 (originally 1) Memory Usage: 3,403kB
76. 7.389 7.389 ↓ 2.0 37,001 1

Seq Scan on post p (cost=0.00..903.75 rows=18,075 width=48) (actual time=0.008..7.389 rows=37,001 loops=1)

77. 442.946 442.946 ↑ 1.0 1 221,473

Index Scan using es_entityid_party on entitystatus docs_status (cost=0.41..1.03 rows=1 width=80) (actual time=0.002..0.002 rows=1 loops=221,473)

  • Index Cond: ((entityid = docs.id) AND (party = uc.party))
  • Filter: (status <> ALL ('{SIGNED,NSIGNED,CANCELLED,NCANCELLED}'::text[]))
  • Rows Removed by Filter: 0
Planning time : 9.387 ms
Execution time : 34,816.916 ms