explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FB71

Settings

Optimization(s) for this plan:

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

Aggregate (cost=16,529,880.72..16,529,880.73 rows=1 width=8) (actual rows= loops=)

2.          

CTE p

3. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on events events_1 (cost=148,209.32..8,276,421.98 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..148,209.32 rows=3,063,217 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 Semi Join (cost=148,209.68..8,253,457.44 rows=520 width=8) (actual rows= loops=)

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

Bitmap Heap Scan on events (cost=148,209.58..8,253,448.11 rows=1,041 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..148,209.32 rows=3,063,217 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=)