explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ccKw

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 0.271 ↑ 67.0 2 1

Sort (cost=597.02..597.35 rows=134 width=950) (actual time=0.270..0.271 rows=2 loops=1)

  • Sort Key: tickets.created_at
  • Sort Method: quicksort Memory: 26kB
2. 0.005 0.256 ↑ 67.0 2 1

Nested Loop (cost=235.27..592.28 rows=134 width=950) (actual time=0.242..0.256 rows=2 loops=1)

3. 0.011 0.227 ↑ 67.0 2 1

HashAggregate (cost=234.84..236.18 rows=134 width=4) (actual time=0.226..0.227 rows=2 loops=1)

  • Group Key: items.ticket_id
4. 0.010 0.216 ↑ 67.0 2 1

HashAggregate (cost=231.82..233.16 rows=134 width=1,092) (actual time=0.215..0.216 rows=2 loops=1)

  • Group Key: items.id, items.type, items.ticket_id, items.author_type, items.author_id, items.body, items.created_at, items.updated_at
5. 0.000 0.206 ↑ 67.0 2 1

Append (cost=21.73..229.14 rows=134 width=1,092) (actual time=0.187..0.206 rows=2 loops=1)

6. 0.015 0.192 ↑ 55.0 2 1

Hash Semi Join (cost=21.73..174.89 rows=110 width=205) (actual time=0.187..0.192 rows=2 loops=1)

  • Hash Cond: (items.source_id = sources.id)
7. 0.004 0.061 ↑ 63.0 2 1

Nested Loop (cost=5.86..157.47 rows=126 width=209) (actual time=0.056..0.061 rows=2 loops=1)

8. 0.003 0.035 ↑ 1.0 1 1

HashAggregate (cost=5.30..5.31 rows=1 width=4) (actual time=0.034..0.035 rows=1 loops=1)

  • Group Key: social_profiles.id
9. 0.001 0.032 ↑ 1.0 1 1

Nested Loop Semi Join (cost=0.85..5.30 rows=1 width=4) (actual time=0.031..0.032 rows=1 loops=1)

10. 0.018 0.018 ↑ 1.0 1 1

Index Scan using index_social_profiles_on_client_user_id on social_profiles (cost=0.43..2.65 rows=1 width=8) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (client_user_id = 1345144)
11. 0.013 0.013 ↑ 1.0 1 1

Index Only Scan using client_users_pkey on client_users (cost=0.43..2.65 rows=1 width=4) (actual time=0.013..0.013 rows=1 loops=1)

  • Index Cond: (id = 1345144)
  • Heap Fetches: 0
12. 0.022 0.022 ↑ 63.0 2 1

Index Scan using index_items_on_author_id_and_author_type on items (cost=0.56..150.90 rows=126 width=209) (actual time=0.019..0.022 rows=2 loops=1)

  • Index Cond: ((author_id = social_profiles.id) AND ((author_type)::text = 'SocialProfile'::text))
  • Filter: ((type)::text = 'Message'::text)
13. 0.017 0.116 ↑ 1.0 58 1

Hash (cost=15.14..15.14 rows=58 width=4) (actual time=0.116..0.116 rows=58 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
14. 0.038 0.099 ↑ 1.0 58 1

Hash Semi Join (cost=1.38..15.14 rows=58 width=4) (actual time=0.048..0.099 rows=58 loops=1)

  • Hash Cond: (sources.workspace_id = workspaces.id)
15. 0.051 0.051 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on sources (cost=0.27..13.24 rows=58 width=8) (actual time=0.020..0.051 rows=58 loops=1)

  • Heap Fetches: 4
16. 0.006 0.010 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=4) (actual time=0.010..0.010 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.004 0.004 ↑ 1.0 5 1

Seq Scan on workspaces (cost=0.00..1.05 rows=5 width=4) (actual time=0.004..0.004 rows=5 loops=1)

18. 0.001 0.014 ↓ 0.0 0 1

Nested Loop (cost=16.86..52.91 rows=24 width=205) (actual time=0.014..0.014 rows=0 loops=1)

19. 0.004 0.004 ↑ 1.0 1 1

Index Only Scan using client_users_pkey on client_users client_users_1 (cost=0.43..2.65 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id = 1345144)
  • Heap Fetches: 0
20. 0.001 0.009 ↓ 0.0 0 1

Hash Semi Join (cost=16.43..50.02 rows=24 width=205) (actual time=0.009..0.009 rows=0 loops=1)

  • Hash Cond: (items_1.source_id = sources_1.id)
21. 0.008 0.008 ↓ 0.0 0 1

Index Scan using index_items_on_author_id_and_author_type on items items_1 (cost=0.56..33.82 rows=27 width=209) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((author_id = 1345144) AND ((author_type)::text = 'ClientUser'::text))
  • Filter: ((type)::text = 'Message'::text)
22. 0.000 0.000 ↓ 0.0 0

Hash (cost=15.14..15.14 rows=58 width=4) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=1.38..15.14 rows=58 width=4) (never executed)

  • Hash Cond: (sources_1.workspace_id = workspaces_1.id)
24. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_sources_on_id_and_workspace_id on sources sources_1 (cost=0.27..13.24 rows=58 width=8) (never executed)

  • Heap Fetches: 0
25. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.05..1.05 rows=5 width=4) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Seq Scan on workspaces workspaces_1 (cost=0.00..1.05 rows=5 width=4) (never executed)

27. 0.024 0.024 ↑ 1.0 1 2

Index Scan using index_tickets_on_id_and_uuid on tickets (cost=0.43..2.65 rows=1 width=950) (actual time=0.010..0.012 rows=1 loops=2)

  • Index Cond: (id = items.ticket_id)