explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YAQe

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=23.82..31.60 rows=1 width=925) (actual time=0.011..0.011 rows=0 loops=1)

  • Filter: ((mat.most_recent OR (mat.most_recent IS NULL)) AND (((mat.to_state)::text = ANY ('{assigned,accepted}'::text[])) OR (mat.to_state IS NULL)) AND ((mat.metadata IS NULL) OR ((mat.metadata ->> 'assigned_to'::text) = '3'::text) OR ((mat.metadata ->> 'accepted_by'::text) = '3'::text)))
2. 0.001 0.011 ↓ 0.0 0 1

Nested Loop (cost=22.98..25.34 rows=1 width=832) (actual time=0.011..0.011 rows=0 loops=1)

  • Join Filter: ((v.active_message_count > (count(mat_1.message_id))) AND (m.visit_id = v.id))
3. 0.000 0.010 ↓ 0.0 0 1

Nested Loop (cost=22.98..24.31 rows=1 width=582) (actual time=0.010..0.010 rows=0 loops=1)

  • Join Filter: (m.id = mat_1.message_id)
4. 0.001 0.010 ↓ 0.0 0 1

GroupAggregate (cost=22.98..23.05 rows=1 width=12) (actual time=0.010..0.010 rows=0 loops=1)

  • Group Key: mat_1.message_id
5. 0.000 0.009 ↓ 0.0 0 1

Merge Join (cost=22.98..23.03 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=1)

  • Merge Cond: (mat_1.message_id = m_1.id)
6. 0.005 0.009 ↓ 0.0 0 1

Sort (cost=21.69..21.70 rows=3 width=4) (actual time=0.008..0.009 rows=0 loops=1)

  • Sort Key: mat_1.message_id
  • Sort Method: quicksort Memory: 25kB
7. 0.001 0.004 ↓ 0.0 0 1

Bitmap Heap Scan on message_assignment_transitions mat_1 (cost=4.13..21.67 rows=3 width=4) (actual time=0.004..0.004 rows=0 loops=1)

  • Recheck Cond: most_recent
  • Filter: (((to_state)::text = ANY ('{assigned,accepted}'::text[])) AND ((metadata ->> 'assigned_to'::text) <> '3'::text) AND ((metadata ->> 'accepted_by'::text) <> '3'::text))
8. 0.003 0.003 ↓ 0.0 0 1

Bitmap Index Scan on index_message_assignment_transitions_parent_most_recent (cost=0.00..4.13 rows=335 width=0) (actual time=0.002..0.003 rows=0 loops=1)

9. 0.000 0.000 ↓ 0.0 0

Sort (cost=1.29..1.30 rows=6 width=4) (never executed)

  • Sort Key: m_1.id
10. 0.000 0.000 ↓ 0.0 0

Seq Scan on messages m_1 (cost=0.00..1.21 rows=6 width=4) (never executed)

  • Filter: ((hotel_id = 1) AND ((resolution_state)::text = 'unresolved'::text))
11. 0.000 0.000 ↓ 0.0 0

Seq Scan on messages m (cost=0.00..1.18 rows=6 width=570) (never executed)

  • Filter: ((resolution_state)::text = 'unresolved'::text)
12. 0.000 0.000 ↓ 0.0 0

Seq Scan on visits v (cost=0.00..1.01 rows=1 width=250) (never executed)

  • Filter: ((status)::text <> 'invalid'::text)
13. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on message_assignment_transitions mat (cost=0.84..6.19 rows=3 width=93) (never executed)

  • Recheck Cond: (message_id = m.id)
14. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_message_assignment_transitions_parent_sort (cost=0.00..0.84 rows=3 width=0) (never executed)

  • Index Cond: (message_id = m.id)