explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QyIq

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=306,790.30..306,796.55 rows=25 width=971) (actual rows= loops=)

  • Functions: 402
  • Options: Inlining false, Optimization false, Expressions true, Deforming true
2. 0.000 0.000 ↓ 0.0

Unique (cost=306,790.30..399,069.30 rows=369,116 width=971) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=306,790.30..307,713.09 rows=369,116 width=971) (actual rows= loops=)

  • Sort Key: invoice_invoice.received_date DESC, invoice_invoice.id, invoice_invoice.created_date, invoice_invoice.modified_date, invoice_invoice.user_id, invoice_invoice.vendor_id, invoice_invoice.source, invoice_invoice.invoice_type, invoice_invoice.invoice_currency, invoice_invoice.invoice_number, invoice_invoice.invoice_date, invoice_invoice.invoice_subject, invoice_invoice.invoice_status, invoice_invoice.approval_level, invoice_invoice.invoice_total, invoice_invoice.billing_start_date, invoice_invoice.billing_end_date, invoice_invoice.file_type, invoice_invoice.vendor_client_id, invoice_invoice.assigned_to_user_id, invoice_invoice.invoice_net, invoice_invoice.invoice_tax, invoice_invoice.withholding_tax, invoice_invoice.invoice_amount_due, invoice_invoice.native_currency, invoice_invoice.native_total, invoice_invoice.native_net, invoice_invoice.native_tax, invoice_invoice.native_withholding_tax, invoice_invoice.native_invoice_amount_due, invoice_invoice.exchange_rate, invoice_invoice.read_only, invoice_invoice.po_number, invoice_invoice.po_id, invoice_invoice.original_invoice_date, invoice_invoice.original_invoice_subject, invoice_invoice.other_attributes, invoice_invoice.review_id, invoice_vendor.id, invoice_vendor.user_id, invoice_vendor.people_team_id, invoice_vendor.client_id, invoice_vendor.vendor_name, invoice_vendor.vendor_ein, invoice_vendor.vendor_email, invoice_vendor.vendor_phone, invoice_vendor.vendor_contact_name, invoice_vendor.vendor_address_1, invoice_vendor.vendor_address_2, invoice_vendor.vendor_city, invoice_vendor.vendor_state, invoice_vendor.vendor_zip, invoice_vendor.vendor_country, invoice_vendor.vendor_type, invoice_vendor.vendor_status, invoice_vendor.extra_text, invoice_vendor.accruals_enabled, invoice_vendor.tk_rates_enabled, invoice_vendor.pdf_required, invoice_vendor.po_id, invoice_vendor.accounting_code, invoice_vendor.other_attributes, invoice_vendor.tax_authority_id, invoice_vendor.created_date, invoice_vendor.modified_date, invoice_vendor.vendor_bank_id, invoice_vendor.vendor_start_date, invoice_vendor.vendor_end_date, invoice_vendor.vendor_receive_domain, invoice_vendor.vendor_system, invoice_vendor.vendor_client_id, invoice_vendor.vendor_routing_number, invoice_vendor.vendor_account_number, invoice_vendor.vendor_swift_code, invoice_vendor.vendor_wmpd_indic, invoice_vendor.vendor_group_id, invoice_vendor.invoice_reviewer_config_id, invoice_vendor.default_template_id, invoice_vendor.max_cg_admins, invoice_vendor.invoicing_enabled, api_vendorhash.id, api_vendorhash.vendor_id, api_vendorhash.vendor_hash, invoice_purchaseorders.id, invoice_purchaseorders.created_by_user_id, invoice_purchaseorders.client_id, invoice_purchaseorders.po, invoice_purchaseorders.currency, invoice_purchaseorders.amount, invoice_purchaseorders.description, invoice_purchaseorders.enabled, invoice_purchaseorders.deleted, invoice_purchaseorders.created_date, invoice_purchaseorders.modified_date, invoice_purchaseorders.other_attributes, invoice_purchaseorders.external_id, api_invoicehash.id, api_invoicehash.invoice_id, api_invoicehash.invoice_hash
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=131,061.22..160,011.17 rows=369,116 width=971) (actual rows= loops=)

  • Hash Cond: (invoice_invoice.id = api_invoicehash.invoice_id)
5. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=118,467.66..146,448.67 rows=369,116 width=944) (actual rows= loops=)

  • Hash Cond: (invoice_invoice.po_id = invoice_purchaseorders.id)
6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=118,466.64..145,478.72 rows=369,116 width=858) (actual rows= loops=)

  • Hash Cond: (invoice_vendor.id = api_vendorhash.vendor_id)
7. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=118,304.87..144,347.19 rows=369,116 width=810) (actual rows= loops=)

  • Hash Cond: (invoice_invoice.vendor_id = invoice_vendor.id)
8. 0.000 0.000 ↓ 0.0

Seq Scan on invoice_invoice (cost=117,866.10..142,938.66 rows=369,116 width=342) (actual rows= loops=)

  • Filter: ((client_id = 1) AND ((assigned_to_user_id = 3) OR (hashed SubPlan 1) OR (hashed SubPlan 2) OR (hashed SubPlan 9)))
9.          

SubPlan (for Seq Scan)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=851.80..1,256.62 rows=92 width=4) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

HashAggregate (cost=851.38..852.30 rows=92 width=4) (actual rows= loops=)

  • Group Key: reviews_review.id
12. 0.000 0.000 ↓ 0.0

Append (cost=124.87..851.15 rows=92 width=4) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=124.87..504.76 rows=53 width=4) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=124.45..479.94 rows=53 width=4) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

HashAggregate (cost=124.03..124.59 rows=56 width=4) (actual rows= loops=)

  • Group Key: v0.ancestor_id
16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.71..123.89 rows=56 width=4) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.41..3.97 rows=56 width=4) (actual rows= loops=)

  • Group Key: u0.team_id
18. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0 (cost=0.29..3.27 rows=56 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 3)
19. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_descendant_id_ancestor_id_7bc282c4_idx on teams_subteamclosure v0 (cost=0.29..2.13 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (descendant_id = u0.team_id)
20. 0.000 0.000 ↓ 0.0

Index Scan using reviews_review_reviewing_teams_cache_team_id_17552657 on reviews_review_reviewing_teams_cache (cost=0.42..4.20 rows=215 width=8) (actual rows= loops=)

  • Index Cond: (team_id = v0.ancestor_id)
21. 0.000 0.000 ↓ 0.0

Index Only Scan using reviews_review_pkey on reviews_review (cost=0.42..0.47 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = reviews_review_reviewing_teams_cache.review_id)
22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=125.60..345.01 rows=39 width=4) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=125.18..326.64 rows=39 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop (cost=124.89..323.34 rows=7 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Hash Semi Join (cost=124.59..320.84 rows=7 width=4) (actual rows= loops=)

  • Hash Cond: (reviews_reviewerconfig_subscribers.team_id = v0_1.ancestor_id)
26. 0.000 0.000 ↓ 0.0

Seq Scan on reviews_reviewerconfig_subscribers (cost=0.00..167.65 rows=10,865 width=8) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash (cost=123.89..123.89 rows=56 width=4) (actual rows= loops=)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
28. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.71..123.89 rows=56 width=4) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.41..3.97 rows=56 width=4) (actual rows= loops=)

  • Group Key: u0_1.team_id
30. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_1 (cost=0.29..3.27 rows=56 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 3)
31. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_descendant_id_ancestor_id_7bc282c4_idx on teams_subteamclosure v0_1 (cost=0.29..2.13 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (descendant_id = u0_1.team_id)
32. 0.000 0.000 ↓ 0.0

Index Only Scan using reviews_reviewerconfig_pkey on reviews_reviewerconfig (cost=0.29..0.36 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = reviews_reviewerconfig_subscribers.reviewerconfig_id)
33. 0.000 0.000 ↓ 0.0

Index Scan using reviews_review_associated__reviewerconfig_id_8a0654b7 on reviews_review_associated_reviewer_configs (cost=0.29..0.41 rows=6 width=8) (actual rows= loops=)

  • Index Cond: (reviewerconfig_id = reviews_reviewerconfig.id)
34. 0.000 0.000 ↓ 0.0

Index Only Scan using reviews_review_pkey on reviews_review reviews_review_1 (cost=0.42..0.47 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = reviews_review_associated_reviewer_configs.review_id)
35. 0.000 0.000 ↓ 0.0

Index Scan using invoice_invoice_review_id_fddafa4f on invoice_invoice x0 (cost=0.42..4.37 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (review_id = reviews_review.id)
36. 0.000 0.000 ↓ 0.0

Hash Join (cost=13,922.66..64,536.97 rows=79,903 width=4) (actual rows= loops=)

  • Hash Cond: (w2.invoice_id = w0.id)
37. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.44..50,406.01 rows=79,903 width=4) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.01..9,009.08 rows=79,903 width=4) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..88.90 rows=1 width=4) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Seq Scan on matters_legalentity w4 (cost=0.00..2.34 rows=34 width=8) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..2.54 rows=1 width=4) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_ancestor_id_descendant_id_8be13299_uniq on teams_subteamclosure v0_2 (cost=0.29..2.19 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ancestor_id = w4.people_team_id)
43. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_2 (cost=0.29..0.32 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((user_id = 3) AND (team_id = v0_2.descendant_id))
44. 0.000 0.000 ↓ 0.0

Index Scan using invoice_lineitemallocation_b2dbc6f0 on invoice_lineitemallocation w3 (cost=0.43..6,839.65 rows=208,053 width=8) (actual rows= loops=)

  • Index Cond: (legal_entity_id = w4.id)
45. 0.000 0.000 ↓ 0.0

Index Scan using invoice_invoicelineitems_pkey on invoice_invoicelineitems w2 (cost=0.43..0.52 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = w3.line_item_id)
46. 0.000 0.000 ↓ 0.0

Hash (cost=8,648.13..8,648.13 rows=421,847 width=4) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Index Only Scan using invoice_invoice_pkey on invoice_invoice w0 (cost=0.42..8,648.13 rows=421,847 width=4) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Index Only Scan using invoice_invoice_pkey on invoice_invoice aa0 (cost=41,642.90..51,345.22 rows=210,924 width=4) (actual rows= loops=)

  • Filter: (NOT (hashed SubPlan 8))
49.          

SubPlan (for Index Only Scan)

50. 0.000 0.000 ↓ 0.0

Gather (cost=4,992.06..41,488.09 rows=61,755 width=4) (actual rows= loops=)

  • Workers Planned: 1
51. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,392.06..34,712.59 rows=36,326 width=4) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,391.64..14,897.33 rows=36,326 width=4) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on matters_matters y0 (cost=4,391.21..7,703.91 rows=1,405 width=4) (actual rows= loops=)

  • Filter: ((NOT (hashed SubPlan 3)) AND (NOT (hashed SubPlan 4)) AND (NOT (hashed SubPlan 5)) AND (NOT (hashed SubPlan 6)) AND (NOT (hashed SubPlan 7)) AND (client_id = 1))
54.          

SubPlan (for Parallel Seq Scan)

55. 0.000 0.000 ↓ 0.0

Nested Loop (cost=111.56..3,004.43 rows=9,552 width=4) (actual rows= loops=)

56. 0.000 0.000 ↓ 0.0

HashAggregate (cost=111.15..111.16 rows=1 width=8) (actual rows= loops=)

  • Group Key: w0_1.id
57. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.58..111.14 rows=1 width=8) (actual rows= loops=)

  • Join Filter: (w1.permission_id = w0_1.id)
58. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..109.96 rows=1 width=4) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Seq Scan on teams_permissionteam w1 (cost=0.00..1.43 rows=43 width=8) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..2.51 rows=1 width=4) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_ancestor_id_descendant_id_8be13299_uniq on teams_subteamclosure v0_3 (cost=0.29..2.17 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ancestor_id = w1.team_id)
62. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_3 (cost=0.29..0.32 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((user_id = 3) AND (team_id = v0_3.descendant_id))
63. 0.000 0.000 ↓ 0.0

Seq Scan on teams_permission w0_1 (cost=0.00..1.08 rows=8 width=4) (actual rows= loops=)

64. 0.000 0.000 ↓ 0.0

Index Scan using matters_matters_read_perm_id_1833609c on matters_matters x0_1 (cost=0.42..2,129.16 rows=76,412 width=8) (actual rows= loops=)

  • Index Cond: (read_perm_id = w0_1.id)
  • Filter: (client_id = 1)
65. 0.000 0.000 ↓ 0.0

Hash Semi Join (cost=7.28..538.83 rows=6 width=4) (actual rows= loops=)

  • Hash Cond: (w0_2.read_perm_id = v0_5.id)
66. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.00..510.64 rows=5,458 width=8) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..38.43 rows=1 width=4) (actual rows= loops=)

68. 0.000 0.000 ↓ 0.0

Seq Scan on matters_mattergroup w2_1 (cost=0.00..1.14 rows=14 width=8) (actual rows= loops=)

69. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..2.65 rows=1 width=4) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_ancestor_id_descendant_id_8be13299_uniq on teams_subteamclosure v0_4 (cost=0.29..2.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ancestor_id = w2_1.people_team_id)
71. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_4 (cost=0.29..0.32 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((user_id = 3) AND (team_id = v0_4.descendant_id))
72. 0.000 0.000 ↓ 0.0

Index Scan using matters_matters_matter_group_id_f0949d04 on matters_matters w0_2 (cost=0.42..417.72 rows=5,449 width=12) (actual rows= loops=)

  • Index Cond: (matter_group_id = w2_1.id)
  • Filter: (client_id = 1)
73. 0.000 0.000 ↓ 0.0

Hash (cost=6.26..6.26 rows=1 width=8) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.58..6.26 rows=1 width=8) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.45..5.99 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (v1.team_id = u0_5.id)
76. 0.000 0.000 ↓ 0.0

Seq Scan on teams_permissionteam v1 (cost=0.00..1.43 rows=43 width=8) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

Hash (cost=4.44..4.44 rows=1 width=4) (actual rows= loops=)

78. 0.000 0.000 ↓ 0.0

Index Scan using teams_team_system_managed_f60768d0_like on teams_team u0_5 (cost=0.42..4.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (system_managed = 'mattergroup'::text)
  • Filter: (client_id = 1)
79. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_permission_pkey on teams_permission v0_5 (cost=0.13..0.24 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = v1.permission_id)
80. 0.000 0.000 ↓ 0.0

Hash Semi Join (cost=7.28..336.05 rows=6 width=4) (actual rows= loops=)

  • Hash Cond: (w0_3.read_perm_id = v0_7.id)
81. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.00..320.75 rows=2,247 width=8) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..88.90 rows=1 width=4) (actual rows= loops=)

83. 0.000 0.000 ↓ 0.0

Seq Scan on matters_legalentity w2_2 (cost=0.00..2.34 rows=34 width=8) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.58..2.54 rows=1 width=4) (actual rows= loops=)

85. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_ancestor_id_descendant_id_8be13299_uniq on teams_subteamclosure v0_6 (cost=0.29..2.19 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (ancestor_id = w2_2.people_team_id)
86. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_6 (cost=0.29..0.32 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((user_id = 3) AND (team_id = v0_6.descendant_id))
87. 0.000 0.000 ↓ 0.0

Index Scan using matters_matters_b2dbc6f0 on matters_matters w0_3 (cost=0.42..200.83 rows=3,102 width=12) (actual rows= loops=)

  • Index Cond: (legal_entity_id = w2_2.id)
  • Filter: (client_id = 1)
88. 0.000 0.000 ↓ 0.0

Hash (cost=6.26..6.26 rows=1 width=8) (actual rows= loops=)

89. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.58..6.26 rows=1 width=8) (actual rows= loops=)

90. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.45..5.99 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (v1_1.team_id = u0_7.id)
91. 0.000 0.000 ↓ 0.0

Seq Scan on teams_permissionteam v1_1 (cost=0.00..1.43 rows=43 width=8) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Hash (cost=4.44..4.44 rows=1 width=4) (actual rows= loops=)

93. 0.000 0.000 ↓ 0.0

Index Scan using teams_team_system_managed_f60768d0_like on teams_team u0_7 (cost=0.42..4.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (system_managed = 'legalentity'::text)
  • Filter: (client_id = 1)
94. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_permission_pkey on teams_permission v0_7 (cost=0.13..0.24 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = v1_1.permission_id)
95. 0.000 0.000 ↓ 0.0

Hash Semi Join (cost=131.31..335.05 rows=56 width=4) (actual rows= loops=)

  • Hash Cond: (w0_4.read_perm_id = v0_9.id)
96. 0.000 0.000 ↓ 0.0

Nested Loop (cost=125.03..327.09 rows=421 width=8) (actual rows= loops=)

97. 0.000 0.000 ↓ 0.0

Nested Loop (cost=124.74..192.60 rows=421 width=4) (actual rows= loops=)

98. 0.000 0.000 ↓ 0.0

Nested Loop (cost=124.32..142.40 rows=3 width=4) (actual rows= loops=)

99. 0.000 0.000 ↓ 0.0

HashAggregate (cost=124.03..124.59 rows=56 width=4) (actual rows= loops=)

  • Group Key: v0_8.ancestor_id
100. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.71..123.89 rows=56 width=4) (actual rows= loops=)

101. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.41..3.97 rows=56 width=4) (actual rows= loops=)

  • Group Key: u0_8.team_id
102. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_8 (cost=0.29..3.27 rows=56 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 3)
103. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_descendant_id_ancestor_id_7bc282c4_idx on teams_subteamclosure v0_8 (cost=0.29..2.13 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (descendant_id = u0_8.team_id)
104. 0.000 0.000 ↓ 0.0

Index Scan using invoice_vendor_people_team_id_e2bba6b2 on invoice_vendor w3_1 (cost=0.28..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (people_team_id = v0_8.ancestor_id)
105. 0.000 0.000 ↓ 0.0

Index Only Scan using matters_referral_vendor_id_matter_id_44190561_idx on matters_referral w2_3 (cost=0.42..11.08 rows=565 width=8) (actual rows= loops=)

  • Index Cond: (vendor_id = w3_1.id)
106. 0.000 0.000 ↓ 0.0

Index Scan using matters_matters_pkey on matters_matters w0_4 (cost=0.29..0.32 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = w2_3.matter_id)
  • Filter: (client_id = 1)
107. 0.000 0.000 ↓ 0.0

Hash (cost=6.26..6.26 rows=1 width=8) (actual rows= loops=)

108. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.58..6.26 rows=1 width=8) (actual rows= loops=)

109. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.45..5.99 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (v1_2.team_id = u0_9.id)
110. 0.000 0.000 ↓ 0.0

Seq Scan on teams_permissionteam v1_2 (cost=0.00..1.43 rows=43 width=8) (actual rows= loops=)

111. 0.000 0.000 ↓ 0.0

Hash (cost=4.44..4.44 rows=1 width=4) (actual rows= loops=)

112. 0.000 0.000 ↓ 0.0

Index Scan using teams_team_system_managed_f60768d0_like on teams_team u0_9 (cost=0.42..4.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (system_managed = 'vendor'::text)
  • Filter: (client_id = 1)
113. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_permission_pkey on teams_permission v0_9 (cost=0.13..0.24 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = v1_2.permission_id)
114. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=128.91..152.78 rows=6 width=4) (actual rows= loops=)

  • Join Filter: (w0_5.read_perm_id = v0_11.id)
115. 0.000 0.000 ↓ 0.0

Nested Loop (cost=124.33..145.77 rows=50 width=8) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

HashAggregate (cost=124.03..124.59 rows=56 width=4) (actual rows= loops=)

  • Group Key: v0_10.ancestor_id
117. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.71..123.89 rows=56 width=4) (actual rows= loops=)

118. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.41..3.97 rows=56 width=4) (actual rows= loops=)

  • Group Key: u0_10.team_id
119. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_membership_user_id_team_id_9e94b906_idx on teams_membership u0_10 (cost=0.29..3.27 rows=56 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 3)
120. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_subteamclosure_descendant_id_ancestor_id_7bc282c4_idx on teams_subteamclosure v0_10 (cost=0.29..2.13 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (descendant_id = u0_10.team_id)
121. 0.000 0.000 ↓ 0.0

Index Scan using matters_matters_people_team_id_3fd421e8 on matters_matters w0_5 (cost=0.29..0.37 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (people_team_id = v0_10.ancestor_id)
  • Filter: (client_id = 1)
122. 0.000 0.000 ↓ 0.0

Materialize (cost=4.58..6.27 rows=1 width=8) (actual rows= loops=)

123. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.58..6.26 rows=1 width=8) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.45..5.99 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (v1_3.team_id = u0_11.id)
125. 0.000 0.000 ↓ 0.0

Seq Scan on teams_permissionteam v1_3 (cost=0.00..1.43 rows=43 width=8) (actual rows= loops=)

126. 0.000 0.000 ↓ 0.0

Hash (cost=4.44..4.44 rows=1 width=4) (actual rows= loops=)

127. 0.000 0.000 ↓ 0.0

Index Scan using teams_team_system_managed_f60768d0_like on teams_team u0_11 (cost=0.42..4.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (system_managed = 'matters'::text)
  • Filter: (client_id = 1)
128. 0.000 0.000 ↓ 0.0

Index Only Scan using teams_permission_pkey on teams_permission v0_11 (cost=0.13..0.24 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = v1_3.permission_id)
129. 0.000 0.000 ↓ 0.0

Index Only Scan using matters_matters_lineitems_matters_id_invoicelineitems_id_key on matters_matters_lineitems z2 (cost=0.43..4.01 rows=111 width=8) (actual rows= loops=)

  • Index Cond: (matters_id = y0.id)
130. 0.000 0.000 ↓ 0.0

Index Scan using invoice_invoicelineitems_pkey on invoice_invoicelineitems z1 (cost=0.43..0.55 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = z2.invoicelineitems_id)
131. 0.000 0.000 ↓ 0.0

Hash (cost=377.23..377.23 rows=4,923 width=468) (actual rows= loops=)

  • Buckets: 8,192 Batches: 1 Memory Usage: 2,503kB
132. 0.000 0.000 ↓ 0.0

Seq Scan on invoice_vendor (cost=0.00..377.23 rows=4,923 width=468) (actual rows= loops=)

133. 0.000 0.000 ↓ 0.0

Hash (cost=100.23..100.23 rows=4,923 width=48) (actual rows= loops=)

  • Buckets: 8,192 Batches: 1 Memory Usage: 453kB
134. 0.000 0.000 ↓ 0.0

Seq Scan on api_vendorhash (cost=0.00..100.23 rows=4,923 width=48) (actual rows= loops=)

135. 0.000 0.000 ↓ 0.0

Hash (cost=1.01..1.01 rows=1 width=86) (actual rows= loops=)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
136. 0.000 0.000 ↓ 0.0

Seq Scan on invoice_purchaseorders (cost=0.00..1.01 rows=1 width=86) (actual rows= loops=)

137. 0.000 0.000 ↓ 0.0

Hash (cost=7,320.47..7,320.47 rows=421,847 width=27) (actual rows= loops=)

  • Buckets: 524,288 Batches: 1 Memory Usage: 28,752kB
138. 0.000 0.000 ↓ 0.0

Seq Scan on api_invoicehash (cost=0.00..7,320.47 rows=421,847 width=27) (actual rows= loops=)