explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6ULA

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 547.595 ↓ 52.6 1,053 1

Sort (cost=27,889.26..27,889.31 rows=20 width=56) (actual time=547.540..547.595 rows=1,053 loops=1)

  • Sort Key: pickups.market, pickup_events.pickup_id, pickup_events."timestamp", (CASE WHEN ((pickup_events.json ->> 'body'::text) ~~ '%I wanted to follow up to see if you had any questions%'::text) THEN 2 WHEN ((pickup_events.json ->> 'body'::text) ~~ '%I know you are busy so I wanted to touch base to see if you had any questions%'::text) THEN 3 ELSE 1 END)
  • Sort Method: quicksort Memory: 131kB
2. 9.351 550.512 ↓ 52.6 1,053 1

Gather (cost=1,603.25..27,888.83 rows=20 width=56) (actual time=238.799..550.512 rows=1,053 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.063 541.161 ↓ 17.6 351 3 / 3

Parallel Append (cost=603.25..26,886.83 rows=20 width=56) (actual time=248.681..541.161 rows=351 loops=3)

4. 75.197 376.513 ↓ 31.0 248 3 / 3

Nested Loop (cost=2,180.05..14,572.08 rows=8 width=56) (actual time=110.533..376.513 rows=248 loops=3)

5. 295.267 298.592 ↓ 31.0 248 3 / 3

Parallel Bitmap Heap Scan on pickup_events (cost=2,179.76..14,508.93 rows=8 width=208) (actual time=110.154..298.592 rows=248 loops=3)

  • Recheck Cond: ((event_type)::text = 'Email Sent'::text)
  • Filter: (("timestamp" >= '2020-07-01 00:00:00'::timestamp without time zone) AND ("timestamp" <= '2020-07-31 00:00:00'::timestamp without time zone) AND ((json ->> 'subject'::text) = 'Remoov Pickup Estimate'::text))
  • Rows Removed by Filter: 30,754
  • Heap Blocks: exact=894
6. 3.325 3.325 ↓ 1.0 93,006 1 / 3

Bitmap Index Scan on index_pickup_events_on_event_type (cost=0.00..2,179.76 rows=92,178 width=0) (actual time=9.974..9.974 rows=93,006 loops=1)

  • Index Cond: ((event_type)::text = 'Email Sent'::text)
7. 2.724 2.724 ↑ 1.0 1 743 / 3

Index Scan using pickups_pkey on pickups (cost=0.29..7.88 rows=1 width=12) (actual time=0.011..0.011 rows=1 loops=743)

  • Index Cond: (id = pickup_events.pickup_id)
8. 0.982 164.585 ↓ 155.0 155 2 / 3

Nested Loop (cost=603.25..12,314.45 rows=1 width=56) (actual time=235.954..246.878 rows=155 loops=2)

9. 158.797 160.090 ↓ 155.0 155 2 / 3

Parallel Bitmap Heap Scan on pickup_events pickup_events_1 (cost=602.96..12,306.13 rows=1 width=208) (actual time=235.650..240.135 rows=155 loops=2)

  • Recheck Cond: ((event_type)::text = 'SMS Sent'::text)
  • Filter: (("timestamp" >= '2020-07-01 00:00:00'::timestamp without time zone) AND ("timestamp" <= '2020-07-31 00:00:00'::timestamp without time zone) AND ((json ->> 'body'::text) ~~ '%The estimated cost of your pickup is%'::text))
  • Rows Removed by Filter: 12,599
  • Heap Blocks: exact=4,548
10. 1.293 1.293 ↓ 1.0 25,508 1 / 3

Bitmap Index Scan on index_pickup_events_on_event_type (cost=0.00..602.96 rows=25,405 width=0) (actual time=3.879..3.879 rows=25,508 loops=1)

  • Index Cond: ((event_type)::text = 'SMS Sent'::text)
11. 3.513 3.513 ↑ 1.0 1 310 / 3

Index Scan using pickups_pkey on pickups pickups_1 (cost=0.29..8.30 rows=1 width=12) (actual time=0.034..0.034 rows=1 loops=310)

  • Index Cond: (id = pickup_events_1.pickup_id)
Planning time : 1.404 ms
Execution time : 552.169 ms