explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iFVc : Optimization for: plan #FB71

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Aggregate (cost=16,489,487.48..16,489,487.49 rows=1 width=8) (actual rows= loops=)

2.          

CTE p

3. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on events (cost=147,740.14..8,256,190.00 rows=3 width=32) (actual rows= loops=)

  • Recheck Cond: ((status = ANY ('{DONE,NEW}'::event_status[])) AND (created_at > (now() - '1 day'::interval)))
  • Filter: (((entity)::text = 'posting'::text) AND ((data ->> 'delivery_type'::text) = ANY ('{PickPoint,PVZ}'::text[])) AND ((data ->> 'state_dst'::text) = 'posting_in_pickup_point'::text) AND (date >= (now() - '7 days'::interval)) AND (date <= (now() - '6 days'::interval)))
4. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on events_status_created_at_scheduled_at_idx (cost=0.00..147,740.14 rows=3,053,100 width=0) (actual rows= loops=)

  • Index Cond: ((status = ANY ('{DONE,NEW}'::event_status[])) AND (created_at > (now() - '1 day'::interval)))
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=147,740.50..8,233,297.44 rows=16 width=8) (actual rows= loops=)

  • Hash Cond: ((e.data ->> 'shipment_id'::text) = p.shipment_id)
6. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on events e (cost=147,740.40..8,233,292.00 rows=1,037 width=1,062) (actual rows= loops=)

  • Recheck Cond: ((status = ANY ('{DONE,NEW}'::event_status[])) AND (created_at > (now() - '1 day'::interval)))
  • Filter: (((entity)::text = 'shipment'::text) AND (date <= now()) AND ((data ->> 'state_dst'::text) = 'shipment_in_pickup_point'::text) AND (date >= (now() - '6 days'::interval)))
7. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on events_status_created_at_scheduled_at_idx (cost=0.00..147,740.14 rows=3,053,100 width=0) (actual rows= loops=)

  • Index Cond: ((status = ANY ('{DONE,NEW}'::event_status[])) AND (created_at > (now() - '1 day'::interval)))
8. 0.000 0.000 ↓ 0.0

Hash (cost=0.06..0.06 rows=3 width=32) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

CTE Scan on p (cost=0.00..0.06 rows=3 width=32) (actual rows= loops=)