explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pr2X

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 135.662 ↑ 1.0 10 1

Limit (cost=800.99..801.00 rows=10 width=184) (actual time=135.661..135.662 rows=10 loops=1)

2. 5.988 135.659 ↑ 3.1 10 1

Sort (cost=800.99..801.01 rows=31 width=184) (actual time=135.659..135.659 rows=10 loops=1)

  • Sort Key: conversations.last_public_element_created_at
  • Sort Method: top-N heapsort Memory: 27kB
3. 18.423 129.671 ↓ 622.8 19,306 1

HashAggregate (cost=800.77..800.86 rows=31 width=184) (actual time=123.714..129.671 rows=19,306 loops=1)

  • Group Key: conversations.id
4. 5.190 111.248 ↓ 622.8 19,306 1

Nested Loop (cost=8.30..800.75 rows=31 width=184) (actual time=0.112..111.248 rows=19,306 loops=1)

5. 2.415 9.523 ↓ 3.9 19,307 1

Nested Loop (cost=8.21..64.03 rows=4,956 width=16) (actual time=0.090..9.523 rows=19,307 loops=1)

6. 0.001 0.055 ↑ 1.0 1 1

Unique (cost=8.13..8.13 rows=1 width=32) (actual time=0.054..0.055 rows=1 loops=1)

7. 0.012 0.054 ↑ 1.0 1 1

Sort (cost=8.13..8.13 rows=1 width=32) (actual time=0.054..0.054 rows=1 loops=1)

  • Sort Key: teams.id
  • Sort Method: quicksort Memory: 25kB
8. 0.002 0.042 ↑ 1.0 1 1

Nested Loop (cost=0.11..8.13 rows=1 width=32) (actual time=0.035..0.042 rows=1 loops=1)

9. 0.017 0.017 ↑ 1.0 1 1

Index Scan using index_teams_users_on_user_id on teams_users (cost=0.06..4.06 rows=1 width=16) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: (user_id = '35a958db-77f8-47d4-b218-16ffe017fc18'::uuid)
10. 0.023 0.023 ↑ 1.0 1 1

Index Scan using teams_pkey on teams (cost=0.06..4.06 rows=1 width=16) (actual time=0.017..0.023 rows=1 loops=1)

  • Index Cond: (id = teams_users.team_id)
  • Filter: (deleted_at IS NULL)
11. 7.053 7.053 ↓ 3.9 19,307 1

Index Scan using index_assignments_on_assignee_id_and_assignee_type on assignments (cost=0.09..41.04 rows=4,956 width=32) (actual time=0.036..7.053 rows=19,307 loops=1)

  • Index Cond: ((assignee_id = teams.id) AND ((assignee_type)::text = 'Team'::text))
  • Filter: (deleted_at IS NULL)
12. 96.535 96.535 ↑ 1.0 1 19,307

Index Scan using conversations_pkey on conversations (cost=0.09..0.15 rows=1 width=184) (actual time=0.005..0.005 rows=1 loops=19,307)

  • Index Cond: (id = assignments.conversation_id)
  • Filter: ((deleted_at IS NULL) AND (business_id = 'a5595c5f-8090-42af-8bd9-9ca8f66a2b0b'::uuid) AND (status = 2))
  • Rows Removed by Filter: 0
Planning time : 1.580 ms