explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yc5F

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 23.318 ↑ 1.0 1 1

Limit (cost=15,996.05..15,996.05 rows=1 width=17) (actual time=23.318..23.318 rows=1 loops=1)

2. 0.192 23.316 ↑ 1.0 1 1

Sort (cost=15,996.05..15,996.05 rows=1 width=17) (actual time=23.316..23.316 rows=1 loops=1)

  • Sort Key: fresh_phone_commitments.commitment
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.000 23.124 ↓ 1,206.0 1,206 1

Nested Loop Anti Join (cost=7,848.19..15,996.04 rows=1 width=17) (actual time=11.047..23.124 rows=1,206 loops=1)

4. 1.591 12.418 ↓ 2.2 1,206 1

Bitmap Heap Scan on fresh_phone_commitments (cost=7,847.77..11,589.84 rows=556 width=17) (actual time=11.022..12.418 rows=1,206 loops=1)

  • Recheck Cond: ((sending_location_id = ANY ('{622aac12-e63c-11ea-82c3-0ff4e0d1db9e}'::uuid[])) AND (truncated_day = date_trunc('day'::text, timezone('Pacific/Honolulu'::text, CURRENT_TIMESTAMP))) AND (commitment <= 200))
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 110
  • Heap Blocks: exact=360
5. 2.491 2.491 ↓ 15.7 17,512 1

Bitmap Index Scan on choose_existing_phone_number_idx (cost=0.00..5,590.45 rows=1,112 width=0) (actual time=2.491..2.491 rows=17,512 loops=1)

  • Index Cond: ((sending_location_id = ANY ('{622aac12-e63c-11ea-82c3-0ff4e0d1db9e}'::uuid[])) AND (truncated_day = date_trunc('day'::text, timezone('Pacific/Honolulu'::text, CURRENT_TIMESTAMP))) AND (commitment <= 200))
6.          

SubPlan (for Bitmap Heap Scan)

7. 1.892 8.336 ↑ 29.1 311 1

HashAggregate (cost=1,895.42..2,234.57 rows=9,044 width=13) (actual time=7.887..8.336 rows=311 loops=1)

  • Group Key: outbound_messages.from_number
  • Filter: (sum(outbound_messages.estimated_segments) > 6)
  • Rows Removed by Filter: 1,236
8. 6.444 6.444 ↑ 5.6 5,303 1

Index Only Scan using outbound_messages_phone_number_overloaded_idx on outbound_messages (cost=0.58..1,748.06 rows=29,472 width=17) (actual time=0.163..6.444 rows=5,303 loops=1)

  • Index Cond: (processed_at > (now() - '00:01:00'::interval))
  • Heap Fetches: 6,428
9. 10.854 10.854 ↓ 0.0 0 1,206

Index Scan using temp_phone_number_idx on all_phone_numbers (cost=0.42..7.91 rows=1 width=13) (actual time=0.009..0.009 rows=0 loops=1,206)

  • Index Cond: ((phone_number)::text = (fresh_phone_commitments.phone_number)::text)
  • Filter: ((released_at IS NULL) AND (cordoned_at IS NOT NULL))
  • Rows Removed by Filter: 1
Planning time : 0.373 ms
Execution time : 23.507 ms