explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 72uD

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 438.499 ↓ 100.0 100 1

Limit (cost=18.18..18.18 rows=1 width=20) (actual time=438.480..438.499 rows=100 loops=1)

2. 0.695 438.489 ↓ 100.0 100 1

Sort (cost=18.18..18.18 rows=1 width=20) (actual time=438.478..438.489 rows=100 loops=1)

  • Sort Key: a.id DESC
  • Sort Method: top-N heapsort Memory: 38kB
3. 3.094 437.794 ↓ 2,948.0 2,948 1

Nested Loop Semi Join (cost=11.27..18.17 rows=1 width=20) (actual time=328.717..437.794 rows=2,948 loops=1)

4. 1.902 396.376 ↓ 2,948.0 2,948 1

Nested Loop (cost=8.33..14.16 rows=1 width=20) (actual time=328.650..396.376 rows=2,948 loops=1)

5. 0.592 370.890 ↓ 2,948.0 2,948 1

Nested Loop (cost=7.90..12.84 rows=1 width=12) (actual time=328.620..370.890 rows=2,948 loops=1)

6. 0.405 346.651 ↓ 1,391.0 1,391 1

Nested Loop (cost=7.47..11.63 rows=1 width=12) (actual time=328.556..346.651 rows=1,391 loops=1)

7. 0.469 329.614 ↓ 1,386.0 1,386 1

Unique (cost=7.04..7.05 rows=1 width=4) (actual time=328.525..329.614 rows=1,386 loops=1)

8. 1.828 329.145 ↓ 4,241.0 4,241 1

Sort (cost=7.04..7.05 rows=1 width=4) (actual time=328.524..329.145 rows=4,241 loops=1)

  • Sort Key: e_1.customer_id
  • Sort Method: quicksort Memory: 366kB
9. 327.317 327.317 ↓ 4,241.0 4,241 1

Index Scan using idx_events_event_datetime on events e_1 (cost=0.57..7.03 rows=1 width=4) (actual time=11.955..327.317 rows=4,241 loops=1)

  • Index Cond: ((event_datetime >= '07/21/2020 00:00:00 MDT'::timestamp with time zone) AND (event_datetime <= '07/23/2020 23:59:59 MDT'::timestamp with time zone))
  • Filter: ((NOT is_deleted) AND (cid = 4,350) AND (property_id = 87,176))
  • Rows Removed by Filter: 235,519
10. 16.632 16.632 ↑ 1.0 1 1,386

Index Scan using idx_applicants_customer_id on applicants ap (cost=0.43..4.55 rows=1 width=12) (actual time=0.012..0.012 rows=1 loops=1,386)

  • Index Cond: (customer_id = e_1.customer_id)
  • Filter: (cid = 4,350)
11. 23.647 23.647 ↓ 2.0 2 1,391

Index Scan using idx_applicant_applications_cid_applicant_id on applicant_applications aa (cost=0.43..1.19 rows=1 width=12) (actual time=0.009..0.017 rows=2 loops=1,391)

  • Index Cond: ((cid = 4,350) AND (applicant_id = ap.id))
  • Filter: ((deleted_on IS NULL) AND (customer_type_id = 1))
  • Rows Removed by Filter: 0
12. 23.584 23.584 ↑ 1.0 1 2,948

Index Scan using pk_applications on applications a (cost=0.43..1.31 rows=1 width=16) (actual time=0.008..0.008 rows=1 loops=2,948)

  • Index Cond: ((cid = 4,350) AND (id = aa.application_id))
  • Filter: (property_id = 87,176)
13. 5.896 38.324 ↑ 1.0 1 2,948

Bitmap Heap Scan on events e (cost=2.93..3.98 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=2,948)

  • Recheck Cond: (((cid = 4,350) AND (lease_interval_id = a.lease_interval_id) AND (event_datetime >= '07/21/2020 00:00:00 MDT'::timestamp with time zone) AND (event_datetime <= '07/23/2020 23:59:59 MDT'::timestamp with time zone)) OR ((cid = 4,350) AND (customer_id = ap.customer_id) AND (event_datetime >= '07/21/2020 00:00:00 MDT'::timestamp with time zone) AND (event_datetime <= '07/23/2020 23:59:59 MDT'::timestamp with time zone)))
  • Filter: ((NOT is_deleted) AND (property_id = 87,176))
  • Heap Blocks: exact=2,948
14. 0.000 32.428 ↓ 0.0 0 2,948

BitmapOr (cost=2.93..2.93 rows=1 width=0) (actual time=0.011..0.011 rows=0 loops=2,948)

15. 20.636 20.636 ↑ 1.0 1 2,948

Bitmap Index Scan on idx_events_cid_lease_interval_id_event_datetime (cost=0.00..1.58 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=2,948)

  • Index Cond: ((cid = 4,350) AND (lease_interval_id = a.lease_interval_id) AND (event_datetime >= '07/21/2020 00:00:00 MDT'::tim:estamp with time zone) AND (event_datetime <= '07/23/2020 23:59:59 MDT'::timestamp with time zone))
16. 14.740 14.740 ↓ 2.0 2 2,948

Bitmap Index Scan on idx_events_cid_customer_id_event_datetime (cost=0.00..1.35 rows=1 width=0) (actual time=0.005..0.005 rows=2 loops=2,948)

  • Index Cond: ((cid = 4,350) AND (customer_id = ap.customer_id) AND (event_datetime >= '07/21/2020 00:00:00 MDT'::timestamp with time zone) AND (event_datetime <= '07/23/2020 23:59:59 MDT'::timestamp with time zone))
Planning time : 11.803 ms
Execution time : 450.917 ms