explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YQe3

Settings
# exclusive inclusive rows x rows loops node
1. 2,509.111 2,509.296 ↑ 1,072,289.0 2 1

Index Scan using index_tickets_on_created_at on tickets (cost=234.40..218,644.21 rows=2,144,578 width=950) (actual time=2,505.488..2,509.296 rows=2 loops=1)

  • Filter: ((hashed SubPlan 1) OR (hashed SubPlan 2))
  • Rows Removed by Filter: 2862502
2.          

SubPlan (for Index Scan)

3. 0.036 0.176 ↑ 55.0 2 1

Hash Semi Join (cost=18.00..173.36 rows=110 width=4) (actual time=0.169..0.176 rows=2 loops=1)

  • Hash Cond: (items.source_id = sources.id)
4. 0.001 0.038 ↑ 63.0 2 1

Nested Loop (cost=0.99..154.80 rows=126 width=8) (actual time=0.034..0.038 rows=2 loops=1)

5. 0.015 0.015 ↑ 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=4) (actual time=0.014..0.015 rows=1 loops=1)

  • Index Cond: (client_user_id = 1345144)
6. 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=12) (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)
7. 0.017 0.102 ↑ 1.0 58 1

Hash (cost=16.28..16.28 rows=58 width=4) (actual time=0.102..0.102 rows=58 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
8. 0.038 0.085 ↑ 1.0 58 1

Hash Semi Join (cost=1.38..16.28 rows=58 width=4) (actual time=0.042..0.085 rows=58 loops=1)

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

Index Only Scan using index_sources_on_id_and_workspace_id on sources (cost=0.27..14.37 rows=58 width=8) (actual time=0.006..0.034 rows=58 loops=1)

  • Heap Fetches: 11
10. 0.006 0.013 ↑ 1.0 5 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.007 0.007 ↑ 1.0 5 1

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

12. 0.000 0.009 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.96..60.27 rows=24 width=4) (actual time=0.009..0.009 rows=0 loops=1)

13. 0.009 0.009 ↓ 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=8) (actual time=0.009..0.009 rows=0 loops=1)

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

Nested Loop Semi Join (cost=0.40..0.97 rows=1 width=4) (never executed)

15. 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..0.77 rows=1 width=8) (never executed)

  • Index Cond: (id = items_1.source_id)
  • Heap Fetches: 0
16. 0.000 0.000 ↓ 0.0 0

Index Only Scan using workspaces_pkey on workspaces workspaces_1 (cost=0.13..0.19 rows=1 width=4) (never executed)

  • Index Cond: (id = sources_1.workspace_id)
  • Heap Fetches: 0