explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 353.553 712.291 ↑ 1.1 62,581 1

WindowAgg (cost=121,815.45..140,396.14 rows=68,186 width=355) (actual time=334.463..712.291 rows=62,581 loops=1)

2. 156.660 358.738 ↑ 1.1 62,581 1

Sort (cost=121,815.45..121,985.92 rows=68,186 width=328) (actual time=332.270..358.738 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. 36.694 202.078 ↑ 1.1 62,581 1

Hash Left Join (cost=1,462.94..116,341.07 rows=68,186 width=328) (actual time=34.193..202.078 rows=62,581 loops=1)

  • Hash Cond: ((e.cid = ce.cid) AND (e.company_employee_id = ce.id))
4. 137.410 165.156 ↑ 1.1 62,581 1

Bitmap Heap Scan on events e (cost=1,374.05..115,894.18 rows=68,186 width=318) (actual time=33.933..165.156 rows=62,581 loops=1)

  • Recheck Cond: (cid = 16033)
  • Filter: ((NOT is_deleted) AND (ps_product_id IS DISTINCT FROM 28))
  • Rows Removed by Filter: 10125
  • Heap Blocks: exact=30307
5. 27.746 27.746 ↑ 1.0 72,716 1

Bitmap Index Scan on pk_events (cost=0.00..1,357.00 rows=73,143 width=0) (actual time=27.746..27.746 rows=72,716 loops=1)

  • Index Cond: (cid = 16033)
6. 0.070 0.228 ↑ 1.0 99 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
7. 0.127 0.158 ↑ 1.0 99 1

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

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

  • Index Cond: (cid = 16033)