explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3b8W

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.020 6.052 ↓ 250.0 250 1

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

  • Buffers: shared hit=3,508
2. 1.082 6.032 ↓ 250.0 250 1

Sort (cost=12.98..12.98 rows=1 width=1,258) (actual time=6.017..6.032 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,508
3. 0.129 4.950 ↓ 901.0 901 1

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

  • Buffers: shared hit=3,508
4. 0.472 3.920 ↓ 901.0 901 1

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

  • Buffers: shared hit=1,706
5. 0.020 0.020 ↑ 1.0 75 1

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

  • Buffers: shared hit=3
6. 0.655 3.428 ↓ 901.0 901 1

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

  • Buffers: shared hit=1,703
7. 2.773 2.773 ↓ 901.0 901 1

Index Scan using messages_conversation_id_account_id_index on messages m0 (cost=0.56..8.59 rows=1 width=1,066) (actual time=0.023..2.773 rows=901 loops=1)

  • Index Cond: ((m0.conversation_id = '8521e3a9-37f6-4e31-8b22-b6de3e7c6d58'::uuid) AND (m0.account_id = '68a42070-b0ff-4994-9e55-2db581ac4e27'::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,703
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.522 ms
Execution time : 6.217 ms