explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cowp

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 6,742.778 ↑ 1.0 1 1

Limit (cost=1,649,836.22..1,649,836.22 rows=1 width=17) (actual time=6,742.776..6,742.778 rows=1 loops=1)

2. 0.102 6,742.775 ↑ 341.0 1 1

Sort (cost=1,649,836.22..1,649,837.07 rows=341 width=17) (actual time=6,742.775..6,742.775 rows=1 loops=1)

  • Sort Key: fresh_phone_commitments.commitment
  • Sort Method: top-N heapsort Memory: 25kB
3. 26.218 6,742.673 ↓ 1.8 608 1

Index Scan using choose_existing_phone_number_idx on fresh_phone_commitments (cost=1,647,121.57..1,649,834.51 rows=341 width=17) (actual time=6,716.507..6,742.673 rows=608 loops=1)

  • Index Cond: ((sending_location_id = ANY ('{39cd1fe8-408d-11ea-b4e6-0bfb129c5e83}'::uuid[])) AND (truncated_day = date_trunc('day'::text, timezone('Pacific/Honolulu'::text, CURRENT_TIMESTAMP))) AND (commitment <= 200))
  • Filter: (NOT (hashed SubPlan 1))
4.          

SubPlan (for Index Scan)

5. 0.002 6,716.455 ↓ 0.0 0 1

GroupAggregate (cost=0.57..1,647,120.95 rows=74 width=13) (actual time=6,716.454..6,716.455 rows=0 loops=1)

  • Group Key: outbound_messages.from_number
  • Filter: (sum(outbound_messages.estimated_segments) > 6)
6. 6,716.453 6,716.453 ↓ 0.0 0 1

Index Scan using outbound_messages_phone_number_overloaded_idx on outbound_messages (cost=0.57..1,647,117.06 rows=222 width=17) (actual time=6,716.453..6,716.453 rows=0 loops=1)

  • Index Cond: (processed_at > (now() - '00:01:00'::interval))
  • Filter: ((sending_location_id = ANY ('{39cd1fe8-408d-11ea-b4e6-0bfb129c5e83}'::uuid[])) AND (stage <> 'awaiting-number'::sms.outbound_message_stages))
Planning time : 0.192 ms
Execution time : 6,742.831 ms