explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ACWQ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 339.798 875.830 ↓ 22.2 62,581 1

WindowAgg (cost=8,269.27..9,038.81 rows=2,824 width=355) (actual time=516.712..875.830 rows=62,581 loops=1)

2. 162.672 536.032 ↓ 22.2 62,581 1

Sort (cost=8,269.27..8,276.33 rows=2,824 width=328) (actual time=516.099..536.032 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. 38.161 373.360 ↓ 22.2 62,581 1

Hash Left Join (cost=89.32..8,107.40 rows=2,824 width=328) (actual time=0.271..373.360 rows=62,581 loops=1)

  • Hash Cond: ((e.cid = ce.cid) AND (e.company_employee_id = ce.id))
4. 24.121 335.011 ↓ 22.2 62,581 1

Nested Loop (cost=0.43..8,003.68 rows=2,824 width=318) (actual time=0.072..335.011 rows=62,581 loops=1)

5. 0.030 0.030 ↑ 1.0 22 1

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

6. 310.860 310.860 ↓ 22.2 2,845 22

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

  • Index Cond: ((cid = 16033) AND (property_id = load_prop.property_id))
  • Filter: ((NOT is_deleted) AND (COALESCE(ps_product_id, 0) <> 28))
  • Rows Removed by Filter: 460
7. 0.047 0.188 ↑ 1.0 99 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
8. 0.121 0.141 ↑ 1.0 99 1

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

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

  • Index Cond: (cid = 16033)