explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ABXd : Optimization for: plan #ACWQ

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 346.147 702.207 ↓ 23.7 62,581 1

WindowAgg (cost=8,255.13..8,976.16 rows=2,646 width=355) (actual time=329.830..702.207 rows=62,581 loops=1)

2. 160.692 356.060 ↓ 23.7 62,581 1

Sort (cost=8,255.13..8,261.74 rows=2,646 width=328) (actual time=329.517..356.060 rows=62,581 loops=1)

  • Sort Key: e.lease_interval_id, ((e.company_employee_id IS NOT NULL)), e.event_datetime
  • Sort Method: quicksort Memory: 37667kB
3. 35.716 195.368 ↓ 23.7 62,581 1

Hash Left Join (cost=89.32..8,104.71 rows=2,646 width=328) (actual time=0.251..195.368 rows=62,581 loops=1)

  • Hash Cond: ((e.cid = ce.cid) AND (e.company_employee_id = ce.id))
4. 22.601 159.463 ↓ 23.7 62,581 1

Nested Loop (cost=0.43..8,001.92 rows=2,646 width=318) (actual time=0.050..159.463 rows=62,581 loops=1)

5. 0.044 0.044 ↑ 1.0 22 1

Seq Scan on load_prop (cost=0.00..1.22 rows=22 width=4) (actual time=0.021..0.044 rows=22 loops=1)

6. 136.818 136.818 ↓ 23.7 2,845 22

Index Scan using idx_events_s1314 on events e (cost=0.43..362.47 rows=120 width=322) (actual time=0.010..6.219 rows=2,845 loops=22)

  • Index Cond: ((cid = 16033) AND (property_id = load_prop.property_id))
  • Filter: ((NOT is_deleted) AND (ps_product_id IS DISTINCT FROM 28))
  • Rows Removed by Filter: 460
7. 0.045 0.189 ↑ 1.0 99 1

Hash (cost=87.41..87.41 rows=99 width=21) (actual time=0.189..0.189 rows=99 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
8. 0.123 0.144 ↑ 1.0 99 1

Bitmap Heap Scan on company_employees ce (cost=5.05..87.41 rows=99 width=21) (actual time=0.033..0.144 rows=99 loops=1)

  • Recheck Cond: (cid = 16033)
  • Heap Blocks: exact=32
9. 0.021 0.021 ↑ 1.0 99 1

Bitmap Index Scan on uk_company_employees_cid_remote_primary_key (cost=0.00..5.02 rows=99 width=0) (actual time=0.021..0.021 rows=99 loops=1)

  • Index Cond: (cid = 16033)