explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S5kK : Optimization for: Optimization for: Optimization for: plan #ACWQ; plan #ABXd; plan #oySW

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 415.020 808.559 ↓ 25.6 72,587 1

WindowAgg (cost=8,263.37..9,036.72 rows=2,838 width=355) (actual time=367.301..808.559 rows=72,587 loops=1)

2. 178.236 393.539 ↓ 25.6 72,587 1

Sort (cost=8,263.37..8,270.46 rows=2,838 width=328) (actual time=364.518..393.539 rows=72,587 loops=1)

  • Sort Key: e.lease_interval_id, ((e.company_employee_id IS NOT NULL)), e.event_datetime
  • Sort Method: quicksort Memory: 44321kB
3. 45.541 215.303 ↓ 25.6 72,587 1

Hash Left Join (cost=89.32..8,100.60 rows=2,838 width=328) (actual time=0.240..215.303 rows=72,587 loops=1)

  • Hash Cond: ((e.cid = ce.cid) AND (e.company_employee_id = ce.id))
4. 26.715 169.558 ↓ 25.6 72,587 1

Nested Loop (cost=0.43..7,996.81 rows=2,838 width=318) (actual time=0.025..169.558 rows=72,587 loops=1)

5. 0.041 0.041 ↑ 1.0 22 1

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

6. 142.802 142.802 ↓ 25.6 3,299 22

Index Scan using idx_events_s1314 on events e (cost=0.43..362.15 rows=129 width=322) (actual time=0.009..6.491 rows=3,299 loops=22)

  • Index Cond: ((cid = 16033) AND (property_id = load_prop.property_id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 5
7. 0.052 0.204 ↑ 1.0 99 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
8. 0.127 0.152 ↑ 1.0 99 1

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

  • Recheck Cond: (cid = 16033)
  • Heap Blocks: exact=32
9. 0.025 0.025 ↑ 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.025..0.025 rows=99 loops=1)

  • Index Cond: (cid = 16033)