explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NVb4

Settings
# exclusive inclusive rows x rows loops node
1. 0.811 526,637.550 ↓ 2,615.0 2,615 1

Unique (cost=3,548.19..3,548.20 rows=1 width=4) (actual time=526,628.747..526,637.550 rows=2,615 loops=1)

2. 1.815 526,636.739 ↓ 2,615.0 2,615 1

Subquery Scan on leases (cost=3,548.19..3,548.20 rows=1 width=4) (actual time=526,628.746..526,636.739 rows=2,615 loops=1)

  • Filter: ((leases.deleted_at IS NULL) AND (leases.rank = 1))
  • Rows Removed by Filter: 2,712
3. 5.049 526,634.924 ↓ 5,327.0 5,327 1

Unique (cost=3,548.19..3,548.19 rows=1 width=108) (actual time=526,628.732..526,634.924 rows=5,327 loops=1)

4. 26.057 526,629.875 ↓ 9,795.0 9,795 1

Sort (cost=3,548.19..3,548.19 rows=1 width=108) (actual time=526,628.731..526,629.875 rows=9,795 loops=1)

  • Sort Key: leases_1.id, leases_1.tenant_id, leases_1.created_at, leases_1.updated_at, leases_1.sourceid, leases_1.deleted_at, leases_1.rentable_area, leases_1.integration_enabled, leases_1.in_place_rent_cached, leases_1.activity_log_id, leases_1.in_place_total_rent_cached, leases_1.expiring_rent_cached, leases_1.retail_lease_type, leases_1.renewal_status, (rank() OVER (?))
  • Sort Method: quicksort Memory: 1,762kB
5. 15.320 526,603.818 ↓ 9,795.0 9,795 1

WindowAgg (cost=3,548.18..3,548.18 rows=1 width=108) (actual time=526,587.282..526,603.818 rows=9,795 loops=1)

6. 11.693 526,588.498 ↓ 9,795.0 9,795 1

Sort (cost=3,548.18..3,548.18 rows=1 width=100) (actual time=526,587.259..526,588.498 rows=9,795 loops=1)

  • Sort Key: slt.space_id, dt.lxd DESC NULLS LAST
  • Sort Method: quicksort Memory: 1,762kB
7. 1,366.995 526,576.805 ↓ 9,795.0 9,795 1

Group (cost=3,548.17..3,548.18 rows=1 width=100) (actual time=521,877.122..526,576.805 rows=9,795 loops=1)

  • Group Key: leases_1.id, slt.space_id, dt.lxd
8. 12,052.457 525,209.810 ↓ 6,793,836.0 6,793,836 1

Sort (cost=3,548.17..3,548.18 rows=1 width=100) (actual time=521,877.117..525,209.810 rows=6,793,836 loops=1)

  • Sort Key: leases_1.id, slt.space_id, dt.lxd
  • Sort Method: external merge Disk: 498,576kB
9. 8,366.831 513,157.353 ↓ 6,793,836.0 6,793,836 1

Nested Loop (cost=1,538.54..3,548.17 rows=1 width=100) (actual time=2,359.018..513,157.353 rows=6,793,836 loops=1)

10. 2,783.652 24,277.168 ↓ 1,656,942.6 8,284,713 1

Nested Loop (cost=1,538.45..3,056.49 rows=5 width=100) (actual time=2,335.534..24,277.168 rows=8,284,713 loops=1)

  • Join Filter: (deal_terms.lease_id = dt.lease_id)
11. 76.625 7,447.570 ↓ 110,598.0 110,598 1

Nested Loop (cost=1,538.34..3,048.80 rows=1 width=100) (actual time=2,333.953..7,447.570 rows=110,598 loops=1)

12. 142.631 7,039.151 ↓ 110,598.0 110,598 1

Nested Loop (cost=1,538.26..3,047.23 rows=1 width=104) (actual time=2,333.939..7,039.151 rows=110,598 loops=1)

13. 130.867 6,564.726 ↓ 110,598.0 110,598 1

Nested Loop (cost=1,538.17..3,044.18 rows=1 width=104) (actual time=2,333.913..6,564.726 rows=110,598 loops=1)

14. 95.273 5,991.467 ↓ 110,598.0 110,598 1

Nested Loop (cost=1,538.09..3,041.08 rows=1 width=104) (actual time=2,333.902..5,991.467 rows=110,598 loops=1)

15. 51.876 5,453.530 ↓ 55,333.0 110,666 1

Nested Loop (cost=1,538.00..3,037.94 rows=2 width=104) (actual time=2,333.874..5,453.530 rows=110,666 loops=1)

  • Join Filter: (deal_terms.lease_id = lease_terms_leases_join.lease_id)
16. 8.198 5,150.734 ↓ 6,273.0 6,273 1

Nested Loop (cost=1,537.89..3,033.65 rows=1 width=96) (actual time=2,333.845..5,150.734 rows=6,273 loops=1)

  • Join Filter: ((user_spaces.space_id = spaces_1.id) AND (asset_roles.can_view_tenants OR ((spaces_1.availability_type)::text <> 'not available'::text) OR (NOT (alternatives: SubPlan 1 or hashed SubPlan 2))))
17. 9.623 5,104.898 ↓ 6,273.0 6,273 1

Nested Loop (cost=1,537.80..3,013.45 rows=1 width=109) (actual time=2,333.811..5,104.898 rows=6,273 loops=1)

18. 12.269 4,681.257 ↓ 697.0 6,273 1

Nested Loop (cost=1,537.72..2,985.78 rows=9 width=17) (actual time=2,330.662..4,681.257 rows=6,273 loops=1)

19. 8.149 3,681.148 ↓ 294.0 16,464 1

Nested Loop (cost=1,537.63..2,810.45 rows=56 width=17) (actual time=2,326.014..3,681.148 rows=16,464 loops=1)

  • Join Filter: (user_spaces.space_id = space_lease_terms.space_id)
20. 7.320 2,696.274 ↓ 162.8 13,023 1

Nested Loop (cost=1,537.55..1,840.50 rows=80 width=9) (actual time=2,322.013..2,696.274 rows=13,023 loops=1)

21. 7.250 2,333.877 ↓ 115.4 13,151 1

Hash Join (cost=1,537.46..1,538.51 rows=114 width=5) (actual time=2,317.906..2,333.877 rows=13,151 loops=1)

  • Hash Cond: (user_spaces.asset_role_id = asset_roles.id)
22. 19.851 2,324.918 ↓ 81.7 13,151 1

HashAggregate (cost=1,528.98..1,529.46 rows=161 width=12) (actual time=2,316.174..2,324.918 rows=13,151 loops=1)

  • Group Key: user_spaces.user_id, user_spaces.space_id, user_spaces.asset_role_id
23. 1.924 2,305.067 ↓ 81.7 13,151 1

Append (cost=0.08..1,528.74 rows=161 width=12) (actual time=9.785..2,305.067 rows=13,151 loops=1)

24. 1.873 1.873 ↓ 0.0 0 1

Index Scan using index_user_spaces_on_user_id on user_spaces (cost=0.08..68.90 rows=36 width=12) (actual time=1.873..1.873 rows=0 loops=1)

  • Index Cond: (user_id = 34,280)
25. 3.572 2,301.270 ↓ 105.2 13,151 1

Nested Loop Anti Join (cost=0.42..1,459.12 rows=125 width=12) (actual time=7.911..2,301.270 rows=13,151 loops=1)

  • Join Filter: (user_spaces_1.user_id = user_properties.user_id)
26. 3.842 2,192.490 ↓ 105.2 13,151 1

Nested Loop (cost=0.34..1,447.44 rows=125 width=12) (actual time=6.208..2,192.490 rows=13,151 loops=1)

27. 0.912 214.038 ↓ 12.7 3,095 1

Nested Loop (cost=0.25..663.88 rows=243 width=12) (actual time=5.186..214.038 rows=3,095 loops=1)

28. 0.293 85.990 ↑ 1.2 116 1

Nested Loop (cost=0.17..588.43 rows=137 width=16) (actual time=2.217..85.990 rows=116 loops=1)

29. 84.073 84.073 ↑ 1.3 116 1

Index Scan using index_user_properties_on_user_id on user_properties (cost=0.09..279.40 rows=148 width=12) (actual time=2.170..84.073 rows=116 loops=1)

  • Index Cond: (user_id = 34,280)
30. 1.624 1.624 ↑ 1.0 1 116

Index Only Scan using index_properties_on_id_no_deleted on properties properties_1 (cost=0.08..2.09 rows=1 width=4) (actual time=0.014..0.014 rows=1 loops=116)

  • Index Cond: (id = user_properties.property_id)
  • Heap Fetches: 116
31. 127.136 127.136 ↑ 2.0 27 116

Index Only Scan using index_floors_on_property_id_and_id_no_deleted on floors floors_1 (cost=0.08..0.39 rows=55 width=8) (actual time=0.330..1.096 rows=27 loops=116)

  • Index Cond: (property_id = properties_1.id)
  • Heap Fetches: 1,552
32. 1,974.610 1,974.610 ↑ 8.5 4 3,095

Index Scan using index_spaces_on_floor_id on spaces spaces_2 (cost=0.09..3.12 rows=34 width=8) (actual time=0.074..0.638 rows=4 loops=3,095)

  • Index Cond: (floor_id = floors_1.id)
  • Filter: (NOT team_override)
33. 105.208 105.208 ↓ 0.0 0 13,151

Index Only Scan using index_user_spaces_on_space_id_and_user_id on user_spaces user_spaces_1 (cost=0.08..0.09 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=13,151)

  • Index Cond: ((space_id = spaces_2.id) AND (user_id = 34,280))
  • Heap Fetches: 0
34. 0.039 1.709 ↓ 1.0 194 1

Hash (cost=7.81..7.81 rows=192 width=5) (actual time=1.708..1.709 rows=194 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
35. 1.670 1.670 ↓ 1.0 194 1

Seq Scan on asset_roles (cost=0.00..7.81 rows=192 width=5) (actual time=0.865..1.670 rows=194 loops=1)

  • Filter: can_view_tenants
  • Rows Removed by Filter: 76
36. 355.077 355.077 ↑ 1.0 1 13,151

Index Only Scan using index_spaces_on_id_no_deleted on spaces (cost=0.09..2.65 rows=1 width=4) (actual time=0.027..0.027 rows=1 loops=13,151)

  • Index Cond: (id = user_spaces.space_id)
  • Heap Fetches: 13,023
37. 976.725 976.725 ↑ 12.0 1 13,023

Index Scan using partial_index_space_lease_terms_on_space_id on space_lease_terms (cost=0.09..12.08 rows=12 width=8) (actual time=0.054..0.075 rows=1 loops=13,023)

  • Index Cond: (space_id = spaces.id)
38. 987.840 987.840 ↓ 0.0 0 16,464

Index Scan using deal_terms_pkey on deal_terms (cost=0.09..3.13 rows=1 width=8) (actual time=0.060..0.060 rows=0 loops=16,464)

  • Index Cond: (id = space_lease_terms.lease_term_id)
  • Filter: ((deleted_at IS NULL) AND ((type)::text = 'LeaseTerm'::text) AND ((lxd > '2020-09-01'::date) OR (lxd IS NULL) OR (is_month_to_month AND ((move_out_date >= '2020-09-01'::date) OR (move_out_date IS NULL)))))
  • Rows Removed by Filter: 1
39. 414.018 414.018 ↑ 1.0 1 6,273

Index Scan using index_leases_on_id_no_deleted on leases leases_1 (cost=0.09..3.07 rows=1 width=92) (actual time=0.066..0.066 rows=1 loops=6,273)

  • Index Cond: (id = deal_terms.lease_id)
40. 37.638 37.638 ↑ 1.0 1 6,273

Index Scan using spaces_pkey on spaces spaces_1 (cost=0.09..3.09 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=6,273)

  • Index Cond: (id = space_lease_terms.space_id)
  • Filter: (deleted_at IS NULL)
41.          

SubPlan (for Nested Loop)

42. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.17..101.78 rows=6 width=0) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Index Scan using index_space_lease_terms_on_space_id on space_lease_terms space_lease_terms_1 (cost=0.09..24.04 rows=19 width=4) (never executed)

  • Index Cond: (space_id = spaces_1.id)
44. 0.000 0.000 ↓ 0.0 0

Index Scan using deal_terms_pkey on deal_terms deal_terms_1 (cost=0.09..4.09 rows=1 width=4) (never executed)

  • Index Cond: (id = space_lease_terms_1.lease_term_id)
  • Filter: ((deleted_at IS NULL) AND ((type)::text = 'LeaseTerm'::text))
45. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1,063,605.32..1,113,287.41 rows=673,328 width=4) (never executed)

  • Hash Cond: (space_lease_terms_2.lease_term_id = deal_terms_2.id)
46. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unique_index_space_lease_terms_on_space_id_and_lease_term_id on space_lease_terms space_lease_terms_2 (cost=0.09..23,090.93 rows=2,040,459 width=8) (never executed)

  • Heap Fetches: 0
47. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,045,445.66..1,045,445.66 rows=2,451,878 width=4) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Seq Scan on deal_terms deal_terms_2 (cost=0.00..1,045,445.66 rows=2,451,878 width=4) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((type)::text = 'LeaseTerm'::text))
49. 250.920 250.920 ↓ 9.0 18 6,273

Index Scan using index_deal_terms_on_lease_id_no_deleted on deal_terms lease_terms_leases_join (cost=0.11..4.28 rows=2 width=8) (actual time=0.009..0.040 rows=18 loops=6,273)

  • Index Cond: (lease_id = leases_1.id)
  • Filter: ((type)::text = 'LeaseTerm'::text)
50. 442.664 442.664 ↑ 1.0 1 110,666

Index Only Scan using partial_index_space_lease_terms_on_lease_term_id_and_space_id on space_lease_terms space_lease_terms_leases_join (cost=0.09..1.57 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=110,666)

  • Index Cond: (lease_term_id = lease_terms_leases_join.id)
  • Heap Fetches: 4,104
51. 442.392 442.392 ↑ 1.0 1 110,598

Index Scan using spaces_pkey on spaces spaces_leases_join (cost=0.09..3.09 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=110,598)

  • Index Cond: (id = space_lease_terms_leases_join.space_id)
  • Filter: (deleted_at IS NULL)
52. 331.794 331.794 ↑ 1.0 1 110,598

Index Scan using index_floors_on_deleted_at_no_deleted on floors (cost=0.08..3.05 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=110,598)

  • Index Cond: (id = spaces_leases_join.floor_id)
53. 331.794 331.794 ↑ 1.0 1 110,598

Index Only Scan using index_properties_on_id_no_deleted on properties (cost=0.08..1.57 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=110,598)

  • Index Cond: (id = floors.property_id)
  • Heap Fetches: 110,598
54. 14,045.946 14,045.946 ↓ 15.0 75 110,598

Index Scan using index_deal_terms_on_lease_id on deal_terms dt (cost=0.11..7.68 rows=5 width=12) (actual time=0.012..0.127 rows=75 loops=110,598)

  • Index Cond: (lease_id = lease_terms_leases_join.lease_id)
55. 24,506.194 480,513.354 ↑ 1.0 1 8,284,713

Index Only Scan using unique_index_space_lease_terms_on_space_id_and_lease_term_id on space_lease_terms slt (cost=0.09..98.33 rows=1 width=8) (actual time=0.058..0.058 rows=1 loops=8,284,713)

  • Index Cond: (lease_term_id = dt.id)
  • Filter: (SubPlan 5)
  • Rows Removed by Filter: 0
  • Heap Fetches: 233,530
56.          

SubPlan (for Index Only Scan)

57. 16,285.970 456,007.160 ↑ 1.0 1 8,142,985

GroupAggregate (cost=23.50..96.76 rows=1 width=8) (actual time=0.056..0.056 rows=1 loops=8,142,985)

  • Group Key: spaces_3.id
  • Filter: (bool_and((deal_terms_5.lxd IS NOT NULL)) AND (max(deal_terms_5.lxd) >= '2020-01-01'::date) AND (max(deal_terms_5.lxd) < '2031-01-01'::date))
  • Rows Removed by Filter: 0
58. 8,142.985 439,721.190 ↑ 1.7 3 8,142,985

Nested Loop (cost=23.50..96.75 rows=5 width=8) (actual time=0.042..0.054 rows=3 loops=8,142,985)

59. 8,142.852 285,004.475 ↑ 1.0 1 8,142,985

Hash Join (cost=23.33..31.36 rows=1 width=4) (actual time=0.033..0.035 rows=1 loops=8,142,985)

  • Hash Cond: (user_spaces_2.asset_role_id = asset_roles_1.id)
  • Join Filter: (asset_roles_1.can_view_tenants OR ((spaces_4.availability_type)::text <> 'not available'::text) OR (NOT (alternatives: SubPlan 3 or hashed SubPlan 4)))
60. 8,142.985 276,861.490 ↑ 2.0 1 8,142,985

Nested Loop (cost=14.85..22.87 rows=2 width=24) (actual time=0.032..0.034 rows=1 loops=8,142,985)

61. 8,142.985 65,143.880 ↑ 1.0 1 8,142,985

Nested Loop (cost=0.17..8.18 rows=1 width=20) (actual time=0.007..0.008 rows=1 loops=8,142,985)

62. 32,571.940 32,571.940 ↑ 1.0 1 8,142,985

Index Only Scan using index_spaces_on_id_no_deleted on spaces spaces_3 (cost=0.09..4.09 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=8,142,985)

  • Index Cond: (id = slt.space_id)
  • Heap Fetches: 8,150,873
63. 24,428.955 24,428.955 ↑ 1.0 1 8,142,985

Index Scan using index_spaces_on_id_no_deleted on spaces spaces_4 (cost=0.09..4.09 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=8,142,985)

  • Index Cond: (id = slt.space_id)
64. 8,142.985 203,574.625 ↑ 2.0 1 8,142,985

Unique (cost=14.67..14.68 rows=2 width=12) (actual time=0.025..0.025 rows=1 loops=8,142,985)

65. 8,142.985 195,431.640 ↑ 2.0 1 8,142,985

Sort (cost=14.67..14.68 rows=2 width=12) (actual time=0.024..0.024 rows=1 loops=8,142,985)

  • Sort Key: user_spaces_2.user_id, user_spaces_2.space_id, user_spaces_2.asset_role_id
  • Sort Method: quicksort Memory: 25kB
66. 8,142.985 187,288.655 ↑ 2.0 1 8,142,985

Append (cost=0.08..14.67 rows=2 width=12) (actual time=0.022..0.023 rows=1 loops=8,142,985)

67. 24,428.955 24,428.955 ↓ 0.0 0 8,142,985

Index Scan using index_user_spaces_on_space_id_and_user_id on user_spaces user_spaces_2 (cost=0.08..4.09 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=8,142,985)

  • Index Cond: ((space_id = slt.space_id) AND (user_id = 34,280))
68. 8,142.985 154,716.715 ↑ 1.0 1 8,142,985

Nested Loop Anti Join (cost=0.42..10.57 rows=1 width=12) (actual time=0.019..0.019 rows=1 loops=8,142,985)

  • Join Filter: (user_spaces_3.space_id = spaces_5.id)
69. 8,142.985 130,287.760 ↑ 1.0 1 8,142,985

Nested Loop (cost=0.34..8.64 rows=1 width=12) (actual time=0.016..0.016 rows=1 loops=8,142,985)

70. 8,142.985 97,715.820 ↑ 1.0 1 8,142,985

Nested Loop (cost=0.26..8.52 rows=1 width=20) (actual time=0.012..0.012 rows=1 loops=8,142,985)

71. 8,142.985 65,143.880 ↑ 1.0 1 8,142,985

Nested Loop (cost=0.17..8.18 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=8,142,985)

72. 32,571.940 32,571.940 ↑ 1.0 1 8,142,985

Index Scan using spaces_pkey on spaces spaces_5 (cost=0.09..4.09 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=8,142,985)

  • Index Cond: (id = slt.space_id)
  • Filter: (NOT team_override)
73. 24,428.955 24,428.955 ↑ 1.0 1 8,142,985

Index Scan using index_floors_on_deleted_at_no_deleted on floors floors_2 (cost=0.08..4.09 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=8,142,985)

  • Index Cond: (id = spaces_5.floor_id)
74. 24,428.955 24,428.955 ↑ 1.0 1 8,142,985

Index Scan using index_user_properties_on_user_id_and_property_id on user_properties user_properties_1 (cost=0.09..0.34 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=8,142,985)

  • Index Cond: ((user_id = 34,280) AND (property_id = floors_2.property_id))
75. 24,428.955 24,428.955 ↑ 1.0 1 8,142,985

Index Only Scan using index_properties_on_id_no_deleted on properties properties_2 (cost=0.08..0.12 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=8,142,985)

  • Index Cond: (id = floors_2.property_id)
  • Heap Fetches: 8,142,985
76. 16,285.970 16,285.970 ↓ 0.0 0 8,142,985

Index Only Scan using index_user_spaces_on_space_id_and_user_id on user_spaces user_spaces_3 (cost=0.08..1.93 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=8,142,985)

  • Index Cond: ((space_id = slt.space_id) AND (user_id = user_properties_1.user_id) AND (user_id = 34,280))
  • Heap Fetches: 0
77. 0.036 0.133 ↓ 1.0 194 1

Hash (cost=7.81..7.81 rows=192 width=5) (actual time=0.133..0.133 rows=194 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
78. 0.097 0.097 ↓ 1.0 194 1

Seq Scan on asset_roles asset_roles_1 (cost=0.00..7.81 rows=192 width=5) (actual time=0.009..0.097 rows=194 loops=1)

  • Filter: can_view_tenants
  • Rows Removed by Filter: 76
79.          

SubPlan (for Hash Join)

80. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.17..101.78 rows=6 width=0) (never executed)

81. 0.000 0.000 ↓ 0.0 0

Index Scan using index_space_lease_terms_on_space_id on space_lease_terms space_lease_terms_3 (cost=0.09..24.04 rows=19 width=4) (never executed)

  • Index Cond: (space_id = spaces_4.id)
82. 0.000 0.000 ↓ 0.0 0

Index Scan using deal_terms_pkey on deal_terms deal_terms_3 (cost=0.09..4.09 rows=1 width=4) (never executed)

  • Index Cond: (id = space_lease_terms_3.lease_term_id)
  • Filter: ((deleted_at IS NULL) AND ((type)::text = 'LeaseTerm'::text))
83. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1,063,605.32..1,113,287.41 rows=673,328 width=4) (never executed)

  • Hash Cond: (space_lease_terms_4.lease_term_id = deal_terms_4.id)
84. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unique_index_space_lease_terms_on_space_id_and_lease_term_id on space_lease_terms space_lease_terms_4 (cost=0.09..23,090.93 rows=2,040,459 width=8) (never executed)

  • Heap Fetches: 0
85. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,045,445.66..1,045,445.66 rows=2,451,878 width=4) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Seq Scan on deal_terms deal_terms_4 (cost=0.00..1,045,445.66 rows=2,451,878 width=4) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((type)::text = 'LeaseTerm'::text))
87. 4,948.057 146,573.730 ↑ 1.3 3 8,142,985

Nested Loop (cost=0.17..65.38 rows=4 width=8) (actual time=0.008..0.018 rows=3 loops=8,142,985)

88. 40,714.925 40,714.925 ↑ 4.0 3 8,142,985

Index Scan using partial_index_space_lease_terms_on_space_id on space_lease_terms space_lease_terms_5 (cost=0.09..16.28 rows=12 width=8) (actual time=0.003..0.005 rows=3 loops=8,142,985)

  • Index Cond: (space_id = slt.space_id)
89. 100,910.748 100,910.748 ↑ 1.0 1 25,227,687

Index Scan using deal_terms_pkey on deal_terms deal_terms_5 (cost=0.09..4.09 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=25,227,687)

  • Index Cond: (id = space_lease_terms_5.lease_term_id)
  • Filter: ((deleted_at IS NULL) AND ((type)::text = 'LeaseTerm'::text))
Planning time : 49.136 ms
Execution time : 526,758.606 ms