explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Y4kT : Optimization for: plan #3b8W

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.019 12.096 ↓ 250.0 250 1

Limit (cost=12.98..12.98 rows=1 width=1,258) (actual time=12.065..12.096 rows=250 loops=1)

  • Buffers: shared hit=3,550 read=24
2. 1.063 12.077 ↓ 250.0 250 1

Sort (cost=12.98..12.98 rows=1 width=1,258) (actual time=12.064..12.077 rows=250 loops=1)

  • Sort Key: (COALESCE(m0.sent_at, m0.inserted_at)) DESC, m0.id DESC
  • Sort Method: top-N heapsort Memory: 943kB
  • Buffers: shared hit=3,550 read=24
3. 0.088 11.014 ↓ 901.0 901 1

Nested Loop (cost=8.74..12.97 rows=1 width=1,258) (actual time=9.573..11.014 rows=901 loops=1)

  • Buffers: shared hit=3,550 read=24
4. 0.472 10.025 ↓ 901.0 901 1

Hash Join (cost=8.6..12.64 rows=1 width=1,183) (actual time=9.562..10.025 rows=901 loops=1)

  • Buffers: shared hit=1,748 read=24
5. 0.017 0.017 ↑ 1.0 75 1

Seq Scan on authorization_assignments a1 (cost=0..3.75 rows=75 width=117) (actual time=0.008..0.017 rows=75 loops=1)

  • Buffers: shared hit=3
6. 0.741 9.536 ↓ 901.0 901 1

Hash (cost=8.59..8.59 rows=1 width=1,066) (actual time=9.536..9.536 rows=901 loops=1)

  • Buffers: shared hit=1,745 read=24
7. 8.795 8.795 ↓ 901.0 901 1

Index Scan using messages_for_subject_idnex on messages m0 (cost=0.56..8.59 rows=1 width=1,066) (actual time=2.649..8.795 rows=901 loops=1)

  • Index Cond: ((m0.account_id = '68a42070-b0ff-4994-9e55-2db581ac4e27'::uuid) AND (m0.conversation_id = '8521e3a9-37f6-4e31-8b22-b6de3e7c6d58'::uuid))
  • Filter: (((m0.type)::text <> 'call'::text) AND (((m0.type)::text <> ALL ('{note,takeover_request}'::text[])) OR ((m0.direction)::text <> 'internal'::text)))
  • Buffers: shared hit=1,745 read=24
8. 0.901 0.901 ↑ 1.0 1 901

Index Scan using users_pkey on users u2 (cost=0.14..0.32 rows=1 width=51) (actual time=0.001..0.001 rows=1 loops=901)

  • Index Cond: (u2.id = a1.user_id)
  • Buffers: shared hit=1,802
Planning time : 0.667 ms
Execution time : 14.818 ms