explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TTr0

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 80,746.345 ↓ 8.0 8 1

Limit (cost=18,340,951.50..18,340,951.51 rows=1 width=950) (actual time=80,746.342..80,746.345 rows=8 loops=1)

  • Output: tickets.id, tickets.status, tickets.created_at, tickets.updated_at, tickets.category, tickets.assignable_id, tickets.assignable_type, tickets.options, tickets.tags, tickets.request_type, tickets.external_id, tickets.lock_version, tickets.last_client_read, tickets.metadata, tickets.group_id, tickets.enrichments, tickets.client_replied, tickets.external, tickets.origin, tickets.corrupted, tickets.import_mention_thread_comments, tickets.bot_category, tickets.language, tickets.external_url, tickets.priority, tickets.post_type, tickets.hierarchy_tag_id, tickets.ancestry, tickets.last_client_message_created_at, tickets.closed_at, tickets.uuid
  • Buffers: shared hit=37276212 read=199139 dirtied=32 written=72
2. 0.047 80,746.342 ↓ 8.0 8 1

Sort (cost=18,340,951.50..18,340,951.51 rows=1 width=950) (actual time=80,746.341..80,746.342 rows=8 loops=1)

  • Output: tickets.id, tickets.status, tickets.created_at, tickets.updated_at, tickets.category, tickets.assignable_id, tickets.assignable_type, tickets.options, tickets.tags, tickets.request_type, tickets.external_id, tickets.lock_version, tickets.last_client_read, tickets.metadata, tickets.group_id, tickets.enrichments, tickets.client_replied, tickets.external, tickets.origin, tickets.corrupted, tickets.import_mention_thread_comments, tickets.bot_category, tickets.language, tickets.external_url, tickets.priority, tickets.post_type, tickets.hierarchy_tag_id, tickets.ancestry, tickets.last_client_message_created_at, tickets.closed_at, tickets.uuid
  • Sort Key: tickets.created_at
  • Sort Method: quicksort Memory: 28kB
  • Buffers: shared hit=37276212 read=199139 dirtied=32 written=72
3. 0.011 80,746.295 ↓ 8.0 8 1

Nested Loop (cost=18,337,860.39..18,340,951.49 rows=1 width=950) (actual time=80,739.572..80,746.295 rows=8 loops=1)

  • Output: tickets.id, tickets.status, tickets.created_at, tickets.updated_at, tickets.category, tickets.assignable_id, tickets.assignable_type, tickets.options, tickets.tags, tickets.request_type, tickets.external_id, tickets.lock_version, tickets.last_client_read, tickets.metadata, tickets.group_id, tickets.enrichments, tickets.client_replied, tickets.external, tickets.origin, tickets.corrupted, tickets.import_mention_thread_comments, tickets.bot_category, tickets.language, tickets.external_url, tickets.priority, tickets.post_type, tickets.hierarchy_tag_id, tickets.ancestry, tickets.last_client_message_created_at, tickets.closed_at, tickets.uuid
  • Buffers: shared hit=37276212 read=199139 dirtied=32 written=72
4. 0.065 80,745.900 ↓ 8.0 8 1

Nested Loop (cost=18,337,860.12..18,340,949.00 rows=1 width=954) (actual time=80,739.209..80,745.900 rows=8 loops=1)

  • Output: tickets.id, tickets.status, tickets.created_at, tickets.updated_at, tickets.category, tickets.assignable_id, tickets.assignable_type, tickets.options, tickets.tags, tickets.request_type, tickets.external_id, tickets.lock_version, tickets.last_client_read, tickets.metadata, tickets.group_id, tickets.enrichments, tickets.client_replied, tickets.external, tickets.origin, tickets.corrupted, tickets.import_mention_thread_comments, tickets.bot_category, tickets.language, tickets.external_url, tickets.priority, tickets.post_type, tickets.hierarchy_tag_id, tickets.ancestry, tickets.last_client_message_created_at, tickets.closed_at, tickets.uuid, items.source_id
  • Buffers: shared hit=37276187 read=199139 dirtied=32 written=72
5. 0.119 80,745.779 ↓ 8.0 8 1

Nested Loop (cost=18,337,858.57..18,340,946.31 rows=1 width=954) (actual time=80,739.176..80,745.779 rows=8 loops=1)

  • Output: tickets.id, tickets.status, tickets.created_at, tickets.updated_at, tickets.category, tickets.assignable_id, tickets.assignable_type, tickets.options, tickets.tags, tickets.request_type, tickets.external_id, tickets.lock_version, tickets.last_client_read, tickets.metadata, tickets.group_id, tickets.enrichments, tickets.client_replied, tickets.external, tickets.origin, tickets.corrupted, tickets.import_mention_thread_comments, tickets.bot_category, tickets.language, tickets.external_url, tickets.priority, tickets.post_type, tickets.hierarchy_tag_id, tickets.ancestry, tickets.last_client_message_created_at, tickets.closed_at, tickets.uuid, items.source_id
  • Buffers: shared hit=37276122 read=199139 dirtied=32 written=72
6. 2,289.395 80,745.612 ↑ 138.1 8 1

Index Scan using index_tickets_on_status_nulls_first on public.tickets (cost=18,337,857.01..18,337,967.28 rows=1,105 width=950) (actual time=80,739.127..80,745.612 rows=8 loops=1)

  • Output: tickets.id, tickets.status, tickets.created_at, tickets.updated_at, tickets.category, tickets.assignable_id, tickets.assignable_type, tickets.options, tickets.tags, tickets.request_type, tickets.external_id, tickets.lock_version, tickets.last_client_read, tickets.metadata, tickets.group_id, tickets.enrichments, tickets.client_replied, tickets.external, tickets.origin, tickets.corrupted, tickets.import_mention_thread_comments, tickets.bot_category, tickets.language, tickets.external_url, tickets.priority, tickets.post_type, tickets.hierarchy_tag_id, tickets.ancestry, tickets.last_client_message_created_at, tickets.closed_at, tickets.uuid
  • Index Cond: ((tickets.status)::text = ANY ('{assigned_to_pool,assigned_to_pool_operator,follow_up,waiting_for_client_feedback}'::text[]))
  • Filter: ((NOT ('{"Competenza Tre da Business"}'::character varying[] && tickets.tags)) AND ((hashed SubPlan 3) OR (hashed SubPlan 4) OR ((hashed SubPlan 5) AND (hashed SubPlan 6) AND (hashed SubPlan 7)) OR (hashed SubPlan 8)))
  • Rows Removed by Filter: 1519
  • Buffers: shared hit=37276056 read=199139 dirtied=32 written=72
7.          

SubPlan (for Index Scan)

8. 0.217 13,767.594 ↑ 2,917.9 1,520 1

Subquery Scan on items_3 (cost=2,914,295.05..3,058,437.85 rows=4,435,163 width=4) (actual time=13,765.300..13,767.594 rows=1,520 loops=1)

  • Output: items_3.ticket_id
  • Buffers: shared hit=9312137 read=53726 dirtied=32 written=55
9. 1.411 13,767.377 ↑ 2,917.9 1,520 1

Unique (cost=2,914,295.05..3,014,086.22 rows=4,435,163 width=1,092) (actual time=13,765.298..13,767.377 rows=1,520 loops=1)

  • Output: items_4.id, items_4.type, items_4.ticket_id, items_4.author_type, items_4.author_id, items_4.body, items_4.created_at, items_4.updated_at
  • Buffers: shared hit=9312137 read=53726 dirtied=32 written=55
10. 8.466 13,765.966 ↑ 2,917.9 1,520 1

Sort (cost=2,914,295.05..2,925,382.96 rows=4,435,163 width=1,092) (actual time=13,765.297..13,765.966 rows=1,520 loops=1)

  • Output: items_4.id, items_4.type, items_4.ticket_id, items_4.author_type, items_4.author_id, items_4.body, items_4.created_at, items_4.updated_at
  • Sort Key: items_4.id, items_4.type, items_4.ticket_id, items_4.author_type, items_4.author_id, items_4.body, items_4.created_at, items_4.updated_at
  • Sort Method: quicksort Memory: 443kB
  • Buffers: shared hit=9312137 read=53726 dirtied=32 written=55
11. 0.228 13,757.500 ↑ 2,917.9 1,520 1

Append (cost=47,263.58..1,181,582.23 rows=4,435,163 width=1,092) (actual time=5,975.602..13,757.500 rows=1,520 loops=1)

  • Buffers: shared hit=9312137 read=53726 dirtied=32 written=55
12. 585.760 8,961.380 ↑ 2,274.6 1,520 1

Hash Semi Join (cost=47,263.58..668,547.43 rows=3,457,397 width=205) (actual time=5,975.601..8,961.380 rows=1,520 loops=1)

  • Output: items_4.id, items_4.type, items_4.ticket_id, items_4.author_type, items_4.author_id, items_4.body, items_4.created_at, items_4.updated_at
  • Hash Cond: (items_4.author_id = social_profiles.id)
  • Buffers: shared hit=3815024 read=42415 dirtied=25
13. 2,161.952 8,045.080 ↓ 1.3 4,532,934 1

Hash Semi Join (cost=15.49..573,756.20 rows=3,458,896 width=205) (actual time=1.091..8,045.080 rows=4,532,934 loops=1)

  • Output: items_4.id, items_4.type, items_4.ticket_id, items_4.author_type, items_4.author_id, items_4.body, items_4.created_at, items_4.updated_at
  • Hash Cond: (items_4.source_id = sources_1.id)
  • Buffers: shared hit=3798246 read=28425 dirtied=12
14. 5,882.747 5,882.747 ↓ 1.1 4,532,934 1

Index Scan using test_items_authors_social_profile on public.items items_4 (cost=0.43..524,885.03 rows=3,952,723 width=209) (actual time=0.273..5,882.747 rows=4,532,934 loops=1)

  • Output: items_4.id, items_4.ticket_id, items_4.source_id, items_4.author_id, items_4.external_id, items_4.body, items_4.created_at, items_4.updated_at, items_4.type, items_4.last_read_at, items_4.author_type, items_4.token, items_4.subject, items_4.external_date, items_4.satisfaction, items_4.vote, items_4.social_feedback, items_4.parent_external_id, items_4.can_reply, items_4.deleted_flag, items_4.job_id, items_4.enrichments, items_4.tags, items_4.response_template_id, items_4.retweet_of, items_4.ancestry, items_4.is_mention, items_4.originator_message_id, items_4.message_type, items_4.tagged_at, items_4.metadata, items_4.client_reply_id, items_4.selected_reply_id, items_4.uuid, items_4.switched_private, items_4.external_api_id
  • Index Cond: ((items_4.type)::text = 'Message'::text)
  • Buffers: shared hit=3798188 read=28425 dirtied=12
15. 0.268 0.381 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.381..0.381 rows=58 loops=1)

  • Output: sources_1.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
16. 0.113 0.113 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_1 (cost=0.27..14.34 rows=58 width=4) (actual time=0.030..0.113 rows=58 loops=1)

  • Output: sources_1.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
17. 0.535 330.540 ↑ 1,714.3 589 1

Hash (cost=34,626.45..34,626.45 rows=1,009,731 width=4) (actual time=330.540..330.540 rows=589 loops=1)

  • Output: social_profiles.id
  • Buckets: 1048576 Batches: 1 Memory Usage: 8213kB
  • Buffers: shared hit=16778 read=13990 dirtied=13
18. 0.476 330.005 ↑ 1,714.3 589 1

Nested Loop (cost=34,624.77..34,626.45 rows=1,009,731 width=4) (actual time=325.855..330.005 rows=589 loops=1)

  • Output: social_profiles.id
  • Buffers: shared hit=16778 read=13990 dirtied=13
19. 0.889 325.995 ↓ 147.2 589 1

HashAggregate (cost=34,624.34..34,624.38 rows=4 width=15) (actual time=325.832..325.995 rows=589 loops=1)

  • Output: client_users.id, client_users_1.id, custom_field_values.binded_key
  • Group Key: client_users.id
  • Buffers: shared hit=14418 read=13990 dirtied=13
20. 7.979 325.106 ↓ 147.2 589 1

Gather (cost=9,186.85..34,624.33 rows=4 width=15) (actual time=87.151..325.106 rows=589 loops=1)

  • Output: client_users.id, client_users_1.id, custom_field_values.binded_key
  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=14418 read=13990 dirtied=13
21. 150.351 317.127 ↓ 147.0 147 4 / 4

Hash Semi Join (cost=8,186.85..33,623.93 rows=1 width=15) (actual time=77.686..317.127 rows=147 loops=4)

  • Output: client_users.id, client_users_1.id, custom_field_values.binded_key
  • Hash Cond: (client_users.id = client_users_1.id)
  • Buffers: shared hit=13632 read=13990 dirtied=13
  • Worker 0: actual time=69.646..315.451 rows=125 loops=1
  • Buffers: shared hit=3118 read=3094 dirtied=3
  • Worker 1: actual time=86.730..316.211 rows=145 loops=1
  • Buffers: shared hit=3475 read=3695 dirtied=3
  • Worker 2: actual time=70.235..316.643 rows=160 loops=1
  • Buffers: shared hit=3392 read=3537 dirtied=4
22. 159.495 159.495 ↑ 1.3 331,568 4 / 4

Parallel Seq Scan on public.client_users (cost=0.00..24,329.26 rows=422,026 width=4) (actual time=0.085..159.495 rows=331,568 loops=4)

  • Output: client_users.id, client_users.created_at, client_users.updated_at, client_users.terms_of_service, client_users.client_code, client_users.pool, client_users.email, client_users.unconfirmed_email, client_users.confirmation_token, client_users.confirmed_at, client_users.confirmation_sent_at, client_users.notifier, client_users.notification_token, client_users.notification_token_type, client_users.note, client_users.bot_routing, client_users.approved_at
  • Buffers: shared hit=6122 read=13987 dirtied=13
  • Worker 0: actual time=0.035..157.407 rows=285269 loops=1
  • Buffers: shared hit=1236 read=3094 dirtied=3
  • Worker 1: actual time=0.077..163.703 rows=350331 loops=1
  • Buffers: shared hit=1593 read=3695 dirtied=3
  • Worker 2: actual time=0.081..162.538 rows=336311 loops=1
  • Buffers: shared hit=1513 read=3534 dirtied=4
23. 0.343 7.281 ↑ 1,110.6 589 4 / 4

Hash (cost=10.09..10.09 rows=654,140 width=11) (actual time=7.281..7.281 rows=589 loops=4)

  • Output: client_users_1.id, custom_field_values.binded_key
  • Buckets: 1048576 Batches: 1 Memory Usage: 8218kB
  • Buffers: shared hit=7471 read=3
  • Worker 0: actual time=5.388..5.388 rows=589 loops=1
  • Buffers: shared hit=1869
  • Worker 1: actual time=7.666..7.666 rows=589 loops=1
  • Buffers: shared hit=1869
  • Worker 2: actual time=10.955..10.955 rows=589 loops=1
  • Buffers: shared hit=1866 read=3
24. 1.203 6.938 ↑ 1,110.6 589 4 / 4

Nested Loop (cost=3.15..10.09 rows=654,140 width=11) (actual time=1.026..6.938 rows=589 loops=4)

  • Output: client_users_1.id, custom_field_values.binded_key
  • Buffers: shared hit=7471 read=3
  • Worker 0: actual time=0.664..5.151 rows=589 loops=1
  • Buffers: shared hit=1869
  • Worker 1: actual time=0.658..7.403 rows=589 loops=1
  • Buffers: shared hit=1869
  • Worker 2: actual time=1.342..10.701 rows=589 loops=1
  • Buffers: shared hit=1866 read=3
25. 0.408 1.023 ↓ 147.2 589 4 / 4

HashAggregate (cost=2.71..2.75 rows=4 width=7) (actual time=0.893..1.023 rows=589 loops=4)

  • Output: custom_field_values.binded_key
  • Group Key: (custom_field_values.binded_key)::integer
  • Buffers: shared hit=102 read=1
  • Worker 0: actual time=0.598..0.747 rows=589 loops=1
  • Buffers: shared hit=26
  • Worker 1: actual time=0.587..0.720 rows=589 loops=1
  • Buffers: shared hit=26
  • Worker 2: actual time=1.227..1.374 rows=589 loops=1
  • Buffers: shared hit=25 read=1
26. 0.615 0.615 ↓ 147.2 589 4 / 4

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values (cost=0.42..2.71 rows=4 width=7) (actual time=0.261..0.615 rows=589 loops=4)

  • Output: custom_field_values.binded_key, (custom_field_values.binded_key)::integer
  • Index Cond: ((custom_field_values.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values.value IS NULL))
  • Heap Fetches: 18
  • Buffers: shared hit=102 read=1
  • Worker 0: actual time=0.102..0.456 rows=589 loops=1
  • Buffers: shared hit=26
  • Worker 1: actual time=0.093..0.431 rows=589 loops=1
  • Buffers: shared hit=26
  • Worker 2: actual time=0.520..1.008 rows=589 loops=1
  • Buffers: shared hit=25 read=1
27. 4.712 4.712 ↑ 1.0 1 2,356 / 4

Index Only Scan using client_users_pkey on public.client_users client_users_1 (cost=0.43..1.82 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=2,356)

  • Output: client_users_1.id
  • Index Cond: (client_users_1.id = (custom_field_values.binded_key)::integer)
  • Heap Fetches: 72
  • Buffers: shared hit=7369 read=2
  • Worker 0: actual time=0.007..0.007 rows=1 loops=589
  • Buffers: shared hit=1843
  • Worker 1: actual time=0.010..0.011 rows=1 loops=589
  • Buffers: shared hit=1843
  • Worker 2: actual time=0.011..0.011 rows=1 loops=589
  • Buffers: shared hit=1841 read=2
28. 3.534 3.534 ↑ 2.0 1 589

Index Scan using index_social_profiles_on_client_user_id on public.social_profiles (cost=0.43..0.50 rows=2 width=8) (actual time=0.006..0.006 rows=1 loops=589)

  • Output: social_profiles.client_user_id, social_profiles.id
  • Index Cond: (social_profiles.client_user_id = client_users_1.id)
  • Buffers: shared hit=2360
29. 0.016 4,795.892 ↓ 0.0 0 1

Hash Semi Join (cost=79,988.08..468,683.17 rows=977,766 width=205) (actual time=4,795.892..4,795.892 rows=0 loops=1)

  • Output: items_5.id, items_5.type, items_5.ticket_id, items_5.author_type, items_5.author_id, items_5.body, items_5.created_at, items_5.updated_at
  • Hash Cond: (items_5.source_id = sources_2.id)
  • Buffers: shared hit=5497113 read=11311 dirtied=7 written=55
30. 191.211 4,795.793 ↓ 0.0 0 1

Merge Semi Join (cost=79,973.02..454,857.39 rows=1,117,362 width=209) (actual time=4,795.793..4,795.793 rows=0 loops=1)

  • Output: items_5.id, items_5.type, items_5.ticket_id, items_5.author_type, items_5.author_id, items_5.body, items_5.created_at, items_5.updated_at, items_5.source_id
  • Merge Cond: (items_5.author_id = client_users_3.id)
  • Buffers: shared hit=5497055 read=11311 dirtied=7 written=55
31. 1,822.716 1,822.716 ↓ 1.1 1,237,186 1

Index Scan using test_items_authors_client_user on public.items items_5 (cost=0.43..402,406.79 rows=1,117,846 width=209) (actual time=0.231..1,822.716 rows=1,237,186 loops=1)

  • Output: items_5.id, items_5.ticket_id, items_5.source_id, items_5.author_id, items_5.external_id, items_5.body, items_5.created_at, items_5.updated_at, items_5.type, items_5.last_read_at, items_5.author_type, items_5.token, items_5.subject, items_5.external_date, items_5.satisfaction, items_5.vote, items_5.social_feedback, items_5.parent_external_id, items_5.can_reply, items_5.deleted_flag, items_5.job_id, items_5.enrichments, items_5.tags, items_5.response_template_id, items_5.retweet_of, items_5.ancestry, items_5.is_mention, items_5.originator_message_id, items_5.message_type, items_5.tagged_at, items_5.metadata, items_5.client_reply_id, items_5.selected_reply_id, items_5.uuid, items_5.switched_private, items_5.external_api_id
  • Index Cond: ((items_5.type)::text = 'Message'::text)
  • Buffers: shared hit=1205608 read=8642 written=49
32. 0.367 2,781.866 ↑ 1,110.6 589 1

Materialize (cost=3.61..69,102.48 rows=654,140 width=15) (actual time=1,880.452..2,781.866 rows=589 loops=1)

  • Output: client_users_2.id, client_users_3.id, custom_field_values_1.binded_key
  • Buffers: shared hit=4291447 read=2669 dirtied=7 written=6
33. 0.000 2,781.499 ↑ 1,110.6 589 1

Nested Loop Semi Join (cost=3.61..67,467.13 rows=654,140 width=15) (actual time=1,880.446..2,781.499 rows=589 loops=1)

  • Output: client_users_2.id, client_users_3.id, custom_field_values_1.binded_key
  • Buffers: shared hit=4291447 read=2669 dirtied=7 written=6
34. 308.843 308.843 ↓ 1.0 1,326,273 1

Index Only Scan using client_users_pkey on public.client_users client_users_2 (cost=0.43..23,674.74 rows=1,308,280 width=4) (actual time=0.024..308.843 rows=1,326,273 loops=1)

  • Output: client_users_2.id
  • Heap Fetches: 181545
  • Buffers: shared hit=126601
35. 1,325.410 2,652.546 ↓ 0.0 0 1,326,273

Hash Semi Join (cost=3.18..3.21 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=1,326,273)

  • Output: client_users_3.id, custom_field_values_1.binded_key
  • Hash Cond: (client_users_3.id = (custom_field_values_1.binded_key)::integer)
  • Buffers: shared hit=4164846 read=2669 dirtied=7 written=6
36. 1,326.273 1,326.273 ↑ 1.0 1 1,326,273

Index Only Scan using client_users_pkey on public.client_users client_users_3 (cost=0.43..0.45 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=1,326,273)

  • Output: client_users_3.id
  • Index Cond: (client_users_3.id = client_users_2.id)
  • Heap Fetches: 181545
  • Buffers: shared hit=4164821 read=2669 dirtied=7 written=6
37. 0.679 0.863 ↓ 147.2 589 1

Hash (cost=2.71..2.71 rows=4 width=7) (actual time=0.863..0.863 rows=589 loops=1)

  • Output: custom_field_values_1.binded_key
  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
  • Buffers: shared hit=25
38. 0.184 0.184 ↓ 147.2 589 1

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_1 (cost=0.42..2.71 rows=4 width=7) (actual time=0.020..0.184 rows=589 loops=1)

  • Output: custom_field_values_1.binded_key
  • Index Cond: ((custom_field_values_1.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_1.value IS NULL))
  • Heap Fetches: 18
  • Buffers: shared hit=25
39. 0.012 0.083 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.083..0.083 rows=58 loops=1)

  • Output: sources_2.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
40. 0.071 0.071 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_2 (cost=0.27..14.34 rows=58 width=4) (actual time=0.009..0.071 rows=58 loops=1)

  • Output: sources_2.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
41. 0.122 17,021.947 ↑ 7,441.5 596 1

Subquery Scan on items_6 (cost=2,894,955.99..3,039,098.79 rows=4,435,163 width=4) (actual time=17,021.424..17,021.947 rows=596 loops=1)

  • Output: items_6.ticket_id
  • Buffers: shared hit=9092374 read=68176 written=12
42. 0.249 17,021.825 ↑ 7,441.5 596 1

Unique (cost=2,894,955.99..2,994,747.16 rows=4,435,163 width=1,092) (actual time=17,021.422..17,021.825 rows=596 loops=1)

  • Output: items_7.id, items_7.type, items_7.ticket_id, items_7.author_type, items_7.author_id, items_7.body, items_7.created_at, items_7.updated_at
  • Buffers: shared hit=9092374 read=68176 written=12
43. 7.914 17,021.576 ↑ 7,441.5 596 1

Sort (cost=2,894,955.99..2,906,043.90 rows=4,435,163 width=1,092) (actual time=17,021.420..17,021.576 rows=596 loops=1)

  • Output: items_7.id, items_7.type, items_7.ticket_id, items_7.author_type, items_7.author_id, items_7.body, items_7.created_at, items_7.updated_at
  • Sort Key: items_7.id, items_7.type, items_7.ticket_id, items_7.author_type, items_7.author_id, items_7.body, items_7.created_at, items_7.updated_at
  • Sort Method: quicksort Memory: 186kB
  • Buffers: shared hit=9092374 read=68176 written=12
44. 0.112 17,013.662 ↑ 7,441.5 596 1

Append (cost=47,346.81..1,162,243.17 rows=4,435,163 width=1,092) (actual time=8,443.003..17,013.662 rows=596 loops=1)

  • Buffers: shared hit=9092374 read=68176 written=12
45. 618.363 9,828.965 ↑ 5,801.0 596 1

Hash Semi Join (cost=47,346.81..668,630.66 rows=3,457,397 width=205) (actual time=8,443.001..9,828.965 rows=596 loops=1)

  • Output: items_7.id, items_7.type, items_7.ticket_id, items_7.author_type, items_7.author_id, items_7.body, items_7.created_at, items_7.updated_at
  • Hash Cond: (items_7.author_id = social_profiles_1.id)
  • Buffers: shared hit=3795748 read=56594 written=12
46. 2,453.433 8,978.763 ↓ 1.3 4,532,934 1

Hash Semi Join (cost=15.49..573,756.20 rows=3,458,896 width=205) (actual time=0.152..8,978.763 rows=4,532,934 loops=1)

  • Output: items_7.id, items_7.type, items_7.ticket_id, items_7.author_type, items_7.author_id, items_7.body, items_7.created_at, items_7.updated_at
  • Hash Cond: (items_7.source_id = sources_3.id)
  • Buffers: shared hit=3782053 read=44597 written=12
47. 6,525.255 6,525.255 ↓ 1.1 4,532,934 1

Index Scan using test_items_authors_social_profile on public.items items_7 (cost=0.43..524,885.03 rows=3,952,723 width=209) (actual time=0.050..6,525.255 rows=4,532,934 loops=1)

  • Output: items_7.id, items_7.ticket_id, items_7.source_id, items_7.author_id, items_7.external_id, items_7.body, items_7.created_at, items_7.updated_at, items_7.type, items_7.last_read_at, items_7.author_type, items_7.token, items_7.subject, items_7.external_date, items_7.satisfaction, items_7.vote, items_7.social_feedback, items_7.parent_external_id, items_7.can_reply, items_7.deleted_flag, items_7.job_id, items_7.enrichments, items_7.tags, items_7.response_template_id, items_7.retweet_of, items_7.ancestry, items_7.is_mention, items_7.originator_message_id, items_7.message_type, items_7.tagged_at, items_7.metadata, items_7.client_reply_id, items_7.selected_reply_id, items_7.uuid, items_7.switched_private, items_7.external_api_id
  • Index Cond: ((items_7.type)::text = 'Message'::text)
  • Buffers: shared hit=3781995 read=44597 written=12
48. 0.012 0.075 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.075..0.075 rows=58 loops=1)

  • Output: sources_3.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
49. 0.063 0.063 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_3 (cost=0.27..14.34 rows=58 width=4) (actual time=0.009..0.063 rows=58 loops=1)

  • Output: sources_3.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
50. 0.424 231.839 ↑ 3,698.6 273 1

Hash (cost=34,709.68..34,709.68 rows=1,009,731 width=4) (actual time=231.839..231.839 rows=273 loops=1)

  • Output: social_profiles_1.id
  • Buckets: 1048576 Batches: 1 Memory Usage: 8202kB
  • Buffers: shared hit=13695 read=11997
51. 0.078 231.415 ↑ 3,698.6 273 1

Nested Loop (cost=34,689.60..34,709.68 rows=1,009,731 width=4) (actual time=229.655..231.415 rows=273 loops=1)

  • Output: social_profiles_1.id
  • Buffers: shared hit=13695 read=11997
52. 0.575 229.699 ↓ 7.0 273 1

HashAggregate (cost=34,689.17..34,689.56 rows=39 width=15) (actual time=229.633..229.699 rows=273 loops=1)

  • Output: client_users_4.id, client_users_5.id, custom_field_values_2.binded_key
  • Group Key: client_users_4.id
  • Buffers: shared hit=12600 read=11997
53. 8.064 229.124 ↓ 7.0 273 1

Gather (cost=9,247.95..34,689.07 rows=39 width=15) (actual time=131.665..229.124 rows=273 loops=1)

  • Output: client_users_4.id, client_users_5.id, custom_field_values_2.binded_key
  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=12600 read=11997
54. 129.389 221.060 ↓ 5.2 68 4 / 4

Hash Semi Join (cost=8,247.95..33,685.17 rows=13 width=15) (actual time=80.499..221.060 rows=68 loops=4)

  • Output: client_users_4.id, client_users_5.id, custom_field_values_2.binded_key
  • Hash Cond: (client_users_4.id = client_users_5.id)
  • Buffers: shared hit=11805 read=11997
  • Worker 0: actual time=80.520..219.885 rows=49 loops=1
  • Buffers: shared hit=2864 read=3184
  • Worker 1: actual time=74.298..218.753 rows=75 loops=1
  • Buffers: shared hit=2992 read=2984
  • Worker 2: actual time=37.384..219.702 rows=57 loops=1
  • Buffers: shared hit=2782 read=2817
55. 86.456 86.456 ↑ 1.3 331,568 4 / 4

Parallel Seq Scan on public.client_users client_users_4 (cost=0.00..24,329.26 rows=422,026 width=4) (actual time=0.041..86.456 rows=331,568 loops=4)

  • Output: client_users_4.id, client_users_4.created_at, client_users_4.updated_at, client_users_4.terms_of_service, client_users_4.client_code, client_users_4.pool, client_users_4.email, client_users_4.unconfirmed_email, client_users_4.confirmation_token, client_users_4.confirmed_at, client_users_4.confirmation_sent_at, client_users_4.notifier, client_users_4.notification_token, client_users_4.notification_token_type, client_users_4.note, client_users_4.bot_routing, client_users_4.approved_at
  • Buffers: shared hit=8112 read=11997
  • Worker 0: actual time=0.040..95.268 rows=348940 loops=1
  • Buffers: shared hit=1937 read=3184
  • Worker 1: actual time=0.066..90.122 rows=330809 loops=1
  • Buffers: shared hit=2065 read=2984
  • Worker 2: actual time=0.041..96.263 rows=312416 loops=1
  • Buffers: shared hit=1855 read=2817
56. 0.214 5.215 ↑ 2,396.1 273 4 / 4

Hash (cost=71.20..71.20 rows=654,140 width=11) (actual time=5.215..5.215 rows=273 loops=4)

  • Output: client_users_5.id, custom_field_values_2.binded_key
  • Buckets: 1048576 Batches: 1 Memory Usage: 8204kB
  • Buffers: shared hit=3654
  • Worker 0: actual time=7.850..7.850 rows=273 loops=1
  • Buffers: shared hit=914
  • Worker 1: actual time=5.599..5.599 rows=273 loops=1
  • Buffers: shared hit=914
  • Worker 2: actual time=5.149..5.149 rows=273 loops=1
  • Buffers: shared hit=914
57. 0.098 5.001 ↑ 2,396.1 273 4 / 4

Nested Loop (cost=9.31..71.20 rows=654,140 width=11) (actual time=1.090..5.001 rows=273 loops=4)

  • Output: client_users_5.id, custom_field_values_2.binded_key
  • Buffers: shared hit=3654
  • Worker 0: actual time=1.032..7.718 rows=273 loops=1
  • Buffers: shared hit=914
  • Worker 1: actual time=1.334..5.406 rows=273 loops=1
  • Buffers: shared hit=914
  • Worker 2: actual time=1.295..5.008 rows=273 loops=1
  • Buffers: shared hit=914
58. 0.239 1.081 ↓ 7.0 273 4 / 4

HashAggregate (cost=8.87..9.26 rows=39 width=7) (actual time=1.008..1.081 rows=273 loops=4)

  • Output: custom_field_values_2.binded_key
  • Group Key: (custom_field_values_2.binded_key)::integer
  • Buffers: shared hit=295
  • Worker 0: actual time=0.926..0.989 rows=273 loops=1
  • Buffers: shared hit=74
  • Worker 1: actual time=1.229..1.328 rows=273 loops=1
  • Buffers: shared hit=74
  • Worker 2: actual time=1.201..1.297 rows=273 loops=1
  • Buffers: shared hit=74
59. 0.842 0.842 ↓ 7.0 273 4 / 4

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_2 (cost=0.42..8.78 rows=39 width=7) (actual time=0.121..0.842 rows=273 loops=4)

  • Output: custom_field_values_2.binded_key, (custom_field_values_2.binded_key)::integer
  • Index Cond: ((custom_field_values_2.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_2.value = ''::text))
  • Heap Fetches: 79
  • Buffers: shared hit=295
  • Worker 0: actual time=0.123..0.858 rows=273 loops=1
  • Buffers: shared hit=74
  • Worker 1: actual time=0.145..1.096 rows=273 loops=1
  • Buffers: shared hit=74
  • Worker 2: actual time=0.164..1.110 rows=273 loops=1
  • Buffers: shared hit=74
60. 3.822 3.822 ↑ 1.0 1 1,092 / 4

Index Only Scan using client_users_pkey on public.client_users client_users_5 (cost=0.43..1.58 rows=1 width=4) (actual time=0.014..0.014 rows=1 loops=1,092)

  • Output: client_users_5.id
  • Index Cond: (client_users_5.id = (custom_field_values_2.binded_key)::integer)
  • Heap Fetches: 15
  • Buffers: shared hit=3359
  • Worker 0: actual time=0.024..0.024 rows=1 loops=273
  • Buffers: shared hit=840
  • Worker 1: actual time=0.014..0.014 rows=1 loops=273
  • Buffers: shared hit=840
  • Worker 2: actual time=0.013..0.013 rows=1 loops=273
  • Buffers: shared hit=840
61. 1.638 1.638 ↑ 2.0 1 273

Index Scan using index_social_profiles_on_client_user_id on public.social_profiles social_profiles_1 (cost=0.43..0.50 rows=2 width=8) (actual time=0.006..0.006 rows=1 loops=273)

  • Output: social_profiles_1.client_user_id, social_profiles_1.id
  • Index Cond: (social_profiles_1.client_user_id = client_users_5.id)
  • Buffers: shared hit=1095
62. 596.177 7,184.585 ↓ 0.0 0 1

Nested Loop Semi Join (cost=25.64..449,260.88 rows=977,766 width=205) (actual time=7,184.585..7,184.585 rows=0 loops=1)

  • Output: items_8.id, items_8.type, items_8.ticket_id, items_8.author_type, items_8.author_id, items_8.body, items_8.created_at, items_8.updated_at
  • Buffers: shared hit=5296626 read=11582
63. 706.434 2,754.321 ↓ 1.3 1,278,029 1

Hash Semi Join (cost=15.49..416,238.56 rows=978,190 width=205) (actual time=0.241..2,754.321 rows=1,278,029 loops=1)

  • Output: items_8.id, items_8.type, items_8.ticket_id, items_8.author_type, items_8.author_id, items_8.body, items_8.created_at, items_8.updated_at
  • Hash Cond: (items_8.source_id = sources_4.id)
  • Buffers: shared hit=1245146 read=9017
64. 2,047.769 2,047.769 ↓ 1.1 1,278,029 1

Index Scan using test_items_authors_client_user on public.items items_8 (cost=0.43..402,406.79 rows=1,117,846 width=209) (actual time=0.051..2,047.769 rows=1,278,029 loops=1)

  • Output: items_8.id, items_8.ticket_id, items_8.source_id, items_8.author_id, items_8.external_id, items_8.body, items_8.created_at, items_8.updated_at, items_8.type, items_8.last_read_at, items_8.author_type, items_8.token, items_8.subject, items_8.external_date, items_8.satisfaction, items_8.vote, items_8.social_feedback, items_8.parent_external_id, items_8.can_reply, items_8.deleted_flag, items_8.job_id, items_8.enrichments, items_8.tags, items_8.response_template_id, items_8.retweet_of, items_8.ancestry, items_8.is_mention, items_8.originator_message_id, items_8.message_type, items_8.tagged_at, items_8.metadata, items_8.client_reply_id, items_8.selected_reply_id, items_8.uuid, items_8.switched_private, items_8.external_api_id
  • Index Cond: ((items_8.type)::text = 'Message'::text)
  • Buffers: shared hit=1245088 read=9017
65. 0.017 0.118 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.118..0.118 rows=58 loops=1)

  • Output: sources_4.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
66. 0.101 0.101 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_4 (cost=0.27..14.34 rows=58 width=4) (actual time=0.014..0.101 rows=58 loops=1)

  • Output: sources_4.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
67. 1,278.016 3,834.087 ↓ 0.0 0 1,278,029

Hash Semi Join (cost=10.16..10.18 rows=1 width=15) (actual time=0.003..0.003 rows=0 loops=1,278,029)

  • Output: client_users_6.id, client_users_7.id, custom_field_values_3.binded_key
  • Hash Cond: (client_users_6.id = client_users_7.id)
  • Buffers: shared hit=4051480 read=2565
68. 0.013 0.013 ↑ 1.0 1 1

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

  • Output: client_users_6.id
  • Index Cond: (client_users_6.id = items_8.author_id)
  • Heap Fetches: 0
  • Buffers: shared hit=4
69. 0.000 2,556.058 ↓ 0.0 0 1,278,029

Hash (cost=9.72..9.72 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=1,278,029)

  • Output: client_users_7.id, custom_field_values_3.binded_key
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=4051476 read=2565
70. 0.000 2,556.058 ↓ 0.0 0 1,278,029

Hash Semi Join (cost=9.69..9.72 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=1,278,029)

  • Output: client_users_7.id, custom_field_values_3.binded_key
  • Hash Cond: (client_users_7.id = (custom_field_values_3.binded_key)::integer)
  • Buffers: shared hit=4051476 read=2565
71. 2,556.058 2,556.058 ↑ 1.0 1 1,278,029

Index Only Scan using client_users_pkey on public.client_users client_users_7 (cost=0.43..0.45 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1,278,029)

  • Output: client_users_7.id
  • Index Cond: (client_users_7.id = items_8.author_id)
  • Heap Fetches: 213249
  • Buffers: shared hit=4051403 read=2565
72. 0.368 0.634 ↓ 7.0 273 1

Hash (cost=8.78..8.78 rows=39 width=7) (actual time=0.634..0.634 rows=273 loops=1)

  • Output: custom_field_values_3.binded_key
  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
  • Buffers: shared hit=73
73. 0.266 0.266 ↓ 7.0 273 1

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_3 (cost=0.42..8.78 rows=39 width=7) (actual time=0.039..0.266 rows=273 loops=1)

  • Output: custom_field_values_3.binded_key
  • Index Cond: ((custom_field_values_3.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_3.value = ''::text))
  • Heap Fetches: 79
  • Buffers: shared hit=73
74. 0.417 30,465.806 ↑ 1,357.1 3,268 1

Subquery Scan on items_9 (cost=2,900,781.26..3,044,924.06 rows=4,435,163 width=4) (actual time=30,464.169..30,465.806 rows=3,268 loops=1)

  • Output: items_9.ticket_id
  • Buffers: shared hit=9705194 read=24580 written=5
75. 0.674 30,465.389 ↑ 1,357.1 3,268 1

Unique (cost=2,900,781.26..3,000,572.43 rows=4,435,163 width=1,092) (actual time=30,464.168..30,465.389 rows=3,268 loops=1)

  • Output: items_10.id, items_10.type, items_10.ticket_id, items_10.author_type, items_10.author_id, items_10.body, items_10.created_at, items_10.updated_at
  • Buffers: shared hit=9705194 read=24580 written=5
76. 3.673 30,464.715 ↑ 1,357.1 3,268 1

Sort (cost=2,900,781.26..2,911,869.17 rows=4,435,163 width=1,092) (actual time=30,464.166..30,464.715 rows=3,268 loops=1)

  • Output: items_10.id, items_10.type, items_10.ticket_id, items_10.author_type, items_10.author_id, items_10.body, items_10.created_at, items_10.updated_at
  • Sort Key: items_10.id, items_10.type, items_10.ticket_id, items_10.author_type, items_10.author_id, items_10.body, items_10.created_at, items_10.updated_at
  • Sort Method: quicksort Memory: 862kB
  • Buffers: shared hit=9705194 read=24580 written=5
77. 0.372 30,461.042 ↑ 1,357.1 3,268 1

Append (cost=53,107.62..1,168,068.44 rows=4,435,163 width=1,092) (actual time=5,402.456..30,461.042 rows=3,268 loops=1)

  • Buffers: shared hit=9705194 read=24580 written=5
78. 554.975 8,058.728 ↑ 1,058.0 3,268 1

Hash Semi Join (cost=53,107.62..674,391.47 rows=3,457,397 width=205) (actual time=5,402.455..8,058.728 rows=3,268 loops=1)

  • Output: items_10.id, items_10.type, items_10.ticket_id, items_10.author_type, items_10.author_id, items_10.body, items_10.created_at, items_10.updated_at
  • Hash Cond: (items_10.author_id = social_profiles_2.id)
  • Buffers: shared hit=3842142 read=21890
79. 2,131.941 7,288.140 ↓ 1.3 4,532,934 1

Hash Semi Join (cost=15.49..573,756.20 rows=3,458,896 width=205) (actual time=0.148..7,288.140 rows=4,532,934 loops=1)

  • Output: items_10.id, items_10.type, items_10.ticket_id, items_10.author_type, items_10.author_id, items_10.body, items_10.created_at, items_10.updated_at
  • Hash Cond: (items_10.source_id = sources_5.id)
  • Buffers: shared hit=3818984 read=7666
80. 5,156.124 5,156.124 ↓ 1.1 4,532,934 1

Index Scan using test_items_authors_social_profile on public.items items_10 (cost=0.43..524,885.03 rows=3,952,723 width=209) (actual time=0.053..5,156.124 rows=4,532,934 loops=1)

  • Output: items_10.id, items_10.ticket_id, items_10.source_id, items_10.author_id, items_10.external_id, items_10.body, items_10.created_at, items_10.updated_at, items_10.type, items_10.last_read_at, items_10.author_type, items_10.token, items_10.subject, items_10.external_date, items_10.satisfaction, items_10.vote, items_10.social_feedback, items_10.parent_external_id, items_10.can_reply, items_10.deleted_flag, items_10.job_id, items_10.enrichments, items_10.tags, items_10.response_template_id, items_10.retweet_of, items_10.ancestry, items_10.is_mention, items_10.originator_message_id, items_10.message_type, items_10.tagged_at, items_10.metadata, items_10.client_reply_id, items_10.selected_reply_id, items_10.uuid, items_10.switched_private, items_10.external_api_id
  • Index Cond: ((items_10.type)::text = 'Message'::text)
  • Buffers: shared hit=3818926 read=7666
81. 0.009 0.075 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.075..0.075 rows=58 loops=1)

  • Output: sources_5.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
82. 0.066 0.066 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_5 (cost=0.27..14.34 rows=58 width=4) (actual time=0.009..0.066 rows=58 loops=1)

  • Output: sources_5.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
83. 0.372 215.613 ↑ 1,055.1 957 1

Hash (cost=40,470.49..40,470.49 rows=1,009,731 width=4) (actual time=215.613..215.613 rows=957 loops=1)

  • Output: social_profiles_2.id
  • Buckets: 1048576 Batches: 1 Memory Usage: 8226kB
  • Buffers: shared hit=23158 read=14224
84. 0.000 215.241 ↑ 1,055.1 957 1

Nested Loop (cost=38,965.63..40,470.49 rows=1,009,731 width=4) (actual time=209.377..215.241 rows=957 loops=1)

  • Output: social_profiles_2.id
  • Buffers: shared hit=23158 read=14224
85. 0.763 209.683 ↑ 3.0 957 1

HashAggregate (cost=38,965.21..38,993.84 rows=2,863 width=15) (actual time=209.358..209.683 rows=957 loops=1)

  • Output: client_users_8.id, client_users_9.id, custom_field_values_4.binded_key
  • Group Key: client_users_8.id
  • Buffers: shared hit=19325 read=14224
86. 8.946 208.920 ↑ 3.0 957 1

Gather (cost=13,224.39..38,958.05 rows=2,863 width=15) (actual time=40.379..208.920 rows=957 loops=1)

  • Output: client_users_8.id, client_users_9.id, custom_field_values_4.binded_key
  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=19325 read=14224
87. 103.986 199.974 ↑ 3.9 239 4 / 4

Hash Semi Join (cost=12,224.39..37,671.75 rows=924 width=15) (actual time=37.867..199.974 rows=239 loops=4)

  • Output: client_users_8.id, client_users_9.id, custom_field_values_4.binded_key
  • Hash Cond: (client_users_8.id = client_users_9.id)
  • Buffers: shared hit=18539 read=14224
  • Worker 0: actual time=28.449..196.804 rows=255 loops=1
  • Buffers: shared hit=4686 read=3753
  • Worker 1: actual time=42.606..196.290 rows=200 loops=1
  • Buffers: shared hit=4362 read=2940
  • Worker 2: actual time=41.459..201.122 rows=204 loops=1
  • Buffers: shared hit=4507 read=3150
88. 84.381 84.381 ↑ 1.3 331,568 4 / 4

Parallel Seq Scan on public.client_users client_users_8 (cost=0.00..24,329.26 rows=422,026 width=4) (actual time=0.038..84.381 rows=331,568 loops=4)

  • Output: client_users_8.id, client_users_8.created_at, client_users_8.updated_at, client_users_8.terms_of_service, client_users_8.client_code, client_users_8.pool, client_users_8.email, client_users_8.unconfirmed_email, client_users_8.confirmation_token, client_users_8.confirmed_at, client_users_8.confirmation_sent_at, client_users_8.notifier, client_users_8.notification_token, client_users_8.notification_token_type, client_users_8.note, client_users_8.bot_routing, client_users_8.approved_at
  • Buffers: shared hit=5885 read=14224
  • Worker 0: actual time=0.052..87.322 rows=348688 loops=1
  • Buffers: shared hit=1518 read=3753
  • Worker 1: actual time=0.041..87.644 rows=271877 loops=1
  • Buffers: shared hit=1194 read=2940
  • Worker 2: actual time=0.043..85.955 rows=298555 loops=1
  • Buffers: shared hit=1339 read=3150
89. 0.384 11.607 ↑ 683.5 957 4 / 4

Hash (cost=4,047.64..4,047.64 rows=654,140 width=11) (actual time=11.607..11.607 rows=957 loops=4)

  • Output: client_users_9.id, custom_field_values_4.binded_key
  • Buckets: 1048576 Batches: 1 Memory Usage: 8234kB
  • Buffers: shared hit=12615
  • Worker 0: actual time=9.983..9.983 rows=957 loops=1
  • Buffers: shared hit=3155
  • Worker 1: actual time=17.737..17.737 rows=957 loops=1
  • Buffers: shared hit=3155
  • Worker 2: actual time=13.417..13.417 rows=957 loops=1
  • Buffers: shared hit=3155
90. 0.194 11.223 ↑ 683.5 957 4 / 4

Nested Loop (cost=450.59..4,047.64 rows=654,140 width=11) (actual time=2.538..11.223 rows=957 loops=4)

  • Output: client_users_9.id, custom_field_values_4.binded_key
  • Buffers: shared hit=12615
  • Worker 0: actual time=2.000..9.601 rows=957 loops=1
  • Buffers: shared hit=3155
  • Worker 1: actual time=4.868..17.332 rows=957 loops=1
  • Buffers: shared hit=3155
  • Worker 2: actual time=2.312..13.011 rows=957 loops=1
  • Buffers: shared hit=3155
91. 1.137 3.373 ↑ 3.0 957 4 / 4

HashAggregate (cost=450.15..478.62 rows=2,847 width=7) (actual time=2.482..3.373 rows=957 loops=4)

  • Output: custom_field_values_4.binded_key
  • Group Key: (custom_field_values_4.binded_key)::integer
  • Buffers: shared hit=744
  • Worker 0: actual time=1.938..2.191 rows=957 loops=1
  • Buffers: shared hit=187
  • Worker 1: actual time=4.802..6.062 rows=957 loops=1
  • Buffers: shared hit=187
  • Worker 2: actual time=2.237..4.158 rows=957 loops=1
  • Buffers: shared hit=187
92. 2.236 2.236 ↑ 3.0 957 4 / 4

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_4 (cost=0.42..443.00 rows=2,863 width=7) (actual time=0.114..2.236 rows=957 loops=4)

  • Output: custom_field_values_4.binded_key, (custom_field_values_4.binded_key)::integer
  • Index Cond: (custom_field_values_4.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Filter: (custom_field_values_4.value <> 'Large'::text)
  • Rows Removed by Filter: 691
  • Heap Fetches: 190
  • Buffers: shared hit=744
  • Worker 0: actual time=0.135..1.692 rows=957 loops=1
  • Buffers: shared hit=187
  • Worker 1: actual time=0.134..4.529 rows=957 loops=1
  • Buffers: shared hit=187
  • Worker 2: actual time=0.146..1.998 rows=957 loops=1
  • Buffers: shared hit=187
93. 7.656 7.656 ↑ 1.0 1 3,828 / 4

Index Only Scan using client_users_pkey on public.client_users client_users_9 (cost=0.43..1.24 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=3,828)

  • Output: client_users_9.id
  • Index Cond: (client_users_9.id = (custom_field_values_4.binded_key)::integer)
  • Heap Fetches: 87
  • Buffers: shared hit=11871
  • Worker 0: actual time=0.007..0.007 rows=1 loops=957
  • Buffers: shared hit=2968
  • Worker 1: actual time=0.011..0.011 rows=1 loops=957
  • Buffers: shared hit=2968
  • Worker 2: actual time=0.009..0.009 rows=1 loops=957
  • Buffers: shared hit=2968
94. 5.742 5.742 ↑ 2.0 1 957

Index Scan using index_social_profiles_on_client_user_id on public.social_profiles social_profiles_2 (cost=0.43..0.50 rows=2 width=8) (actual time=0.005..0.006 rows=1 loops=957)

  • Output: social_profiles_2.client_user_id, social_profiles_2.id
  • Index Cond: (social_profiles_2.client_user_id = client_users_9.id)
  • Buffers: shared hit=3833
95. 403.171 22,401.942 ↓ 0.0 0 1

Nested Loop Semi Join (cost=90.10..449,325.34 rows=977,766 width=205) (actual time=22,401.942..22,401.942 rows=0 loops=1)

  • Output: items_11.id, items_11.type, items_11.ticket_id, items_11.author_type, items_11.author_id, items_11.body, items_11.created_at, items_11.updated_at
  • Buffers: shared hit=5863052 read=2690 written=5
96. 714.717 2,828.336 ↓ 1.3 1,278,029 1

Hash Semi Join (cost=15.49..416,238.56 rows=978,190 width=205) (actual time=0.102..2,828.336 rows=1,278,029 loops=1)

  • Output: items_11.id, items_11.type, items_11.ticket_id, items_11.author_type, items_11.author_id, items_11.body, items_11.created_at, items_11.updated_at
  • Hash Cond: (items_11.source_id = sources_6.id)
  • Buffers: shared hit=1253515 read=648 written=1
97. 2,113.555 2,113.555 ↓ 1.1 1,278,029 1

Index Scan using test_items_authors_client_user on public.items items_11 (cost=0.43..402,406.79 rows=1,117,846 width=209) (actual time=0.021..2,113.555 rows=1,278,029 loops=1)

  • Output: items_11.id, items_11.ticket_id, items_11.source_id, items_11.author_id, items_11.external_id, items_11.body, items_11.created_at, items_11.updated_at, items_11.type, items_11.last_read_at, items_11.author_type, items_11.token, items_11.subject, items_11.external_date, items_11.satisfaction, items_11.vote, items_11.social_feedback, items_11.parent_external_id, items_11.can_reply, items_11.deleted_flag, items_11.job_id, items_11.enrichments, items_11.tags, items_11.response_template_id, items_11.retweet_of, items_11.ancestry, items_11.is_mention, items_11.originator_message_id, items_11.message_type, items_11.tagged_at, items_11.metadata, items_11.client_reply_id, items_11.selected_reply_id, items_11.uuid, items_11.switched_private, items_11.external_api_id
  • Index Cond: ((items_11.type)::text = 'Message'::text)
  • Buffers: shared hit=1253457 read=648 written=1
98. 0.010 0.064 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.064..0.064 rows=58 loops=1)

  • Output: sources_6.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
99. 0.054 0.054 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_6 (cost=0.27..14.34 rows=58 width=4) (actual time=0.007..0.054 rows=58 loops=1)

  • Output: sources_6.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
100. 1,278.020 19,170.435 ↓ 0.0 0 1,278,029

Hash Semi Join (cost=74.61..74.64 rows=1 width=15) (actual time=0.015..0.015 rows=0 loops=1,278,029)

  • Output: client_users_10.id, client_users_11.id, custom_field_values_5.binded_key
  • Hash Cond: (client_users_10.id = client_users_11.id)
  • Buffers: shared hit=4609537 read=2042 written=4
101. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using client_users_pkey on public.client_users client_users_10 (cost=0.43..0.45 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=1)

  • Output: client_users_10.id
  • Index Cond: (client_users_10.id = items_11.author_id)
  • Heap Fetches: 0
  • Buffers: shared hit=4
102. 1,278.029 17,892.406 ↓ 0.0 0 1,278,029

Hash (cost=74.17..74.17 rows=1 width=11) (actual time=0.014..0.014 rows=0 loops=1,278,029)

  • Output: client_users_11.id, custom_field_values_5.binded_key
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=4609533 read=2042 written=4
103. 1,278.026 16,614.377 ↓ 0.0 0 1,278,029

Hash Semi Join (cost=74.15..74.17 rows=1 width=11) (actual time=0.013..0.013 rows=0 loops=1,278,029)

  • Output: client_users_11.id, custom_field_values_5.binded_key
  • Hash Cond: (client_users_11.id = (custom_field_values_5.binded_key)::integer)
  • Buffers: shared hit=4609533 read=2042 written=4
104. 0.003 0.003 ↑ 1.0 1 1

Index Only Scan using client_users_pkey on public.client_users client_users_11 (cost=0.43..0.45 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=1)

  • Output: client_users_11.id
  • Index Cond: (client_users_11.id = items_11.author_id)
  • Heap Fetches: 0
  • Buffers: shared hit=4
105. 1,278.029 15,336.348 ↓ 0.0 0 1,278,029

Hash (cost=73.55..73.55 rows=14 width=7) (actual time=0.012..0.012 rows=0 loops=1,278,029)

  • Output: custom_field_values_5.binded_key
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=4609529 read=2042 written=4
106. 0.000 14,058.319 ↓ 0.0 0 1,278,029

Bitmap Heap Scan on public.custom_field_values custom_field_values_5 (cost=72.13..73.55 rows=14 width=7) (actual time=0.011..0.011 rows=0 loops=1,278,029)

  • Output: custom_field_values_5.binded_key
  • Recheck Cond: (((custom_field_values_5.binded_key)::integer = items_11.author_id) AND (custom_field_values_5.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid))
  • Filter: ((custom_field_values_5.deleted_at IS NULL) AND (custom_field_values_5.value <> 'Large'::text))
  • Buffers: shared hit=4609529 read=2042 written=4
107. 405.906 14,058.319 ↓ 0.0 0 1,278,029

BitmapAnd (cost=72.13..72.13 rows=14 width=0) (actual time=0.011..0.011 rows=0 loops=1,278,029)

  • Buffers: shared hit=4609529 read=2042 written=4
108. 1,278.029 1,278.029 ↓ 0.0 0 1,278,029

Bitmap Index Scan on test_cfv_binded_key_integer (cost=0.00..28.36 rows=3,725 width=0) (actual time=0.001..0.001 rows=0 loops=1,278,029)

  • Index Cond: ((custom_field_values_5.binded_key)::integer = items_11.author_id)
  • Buffers: shared hit=3836130 read=2042 written=4
109. 12,374.384 12,374.384 ↑ 1.7 1,648 70,309

Bitmap Index Scan on test_cfv_cf_id_and_value (cost=0.00..42.80 rows=2,863 width=0) (actual time=0.176..0.176 rows=1,648 loops=70,309)

  • Index Cond: (custom_field_values_5.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Buffers: shared hit=773399
110. 0.000 0.000 ↓ 0.0 0

Subquery Scan on items_12 (cost=2,900,776.85..3,044,919.64 rows=4,435,163 width=4) (never executed)

  • Output: items_12.ticket_id
111. 0.000 0.000 ↓ 0.0 0

Unique (cost=2,900,776.85..3,000,568.01 rows=4,435,163 width=1,092) (never executed)

  • Output: items_13.id, items_13.type, items_13.ticket_id, items_13.author_type, items_13.author_id, items_13.body, items_13.created_at, items_13.updated_at
112. 0.000 0.000 ↓ 0.0 0

Sort (cost=2,900,776.85..2,911,864.75 rows=4,435,163 width=1,092) (never executed)

  • Output: items_13.id, items_13.type, items_13.ticket_id, items_13.author_type, items_13.author_id, items_13.body, items_13.created_at, items_13.updated_at
  • Sort Key: items_13.id, items_13.type, items_13.ticket_id, items_13.author_type, items_13.author_id, items_13.body, items_13.created_at, items_13.updated_at
113. 0.000 0.000 ↓ 0.0 0

Append (cost=53,103.20..1,168,064.03 rows=4,435,163 width=1,092) (never executed)

114. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=53,103.20..674,387.06 rows=3,457,397 width=205) (never executed)

  • Output: items_13.id, items_13.type, items_13.ticket_id, items_13.author_type, items_13.author_id, items_13.body, items_13.created_at, items_13.updated_at
  • Hash Cond: (items_13.author_id = social_profiles_3.id)
115. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=15.49..573,756.20 rows=3,458,896 width=205) (never executed)

  • Output: items_13.id, items_13.type, items_13.ticket_id, items_13.author_type, items_13.author_id, items_13.body, items_13.created_at, items_13.updated_at
  • Hash Cond: (items_13.source_id = sources_7.id)
116. 0.000 0.000 ↓ 0.0 0

Index Scan using test_items_authors_social_profile on public.items items_13 (cost=0.43..524,885.03 rows=3,952,723 width=209) (never executed)

  • Output: items_13.id, items_13.ticket_id, items_13.source_id, items_13.author_id, items_13.external_id, items_13.body, items_13.created_at, items_13.updated_at, items_13.type, items_13.last_read_at, items_13.author_type, items_13.token, items_13.subject, items_13.external_date, items_13.satisfaction, items_13.vote, items_13.social_feedback, items_13.parent_external_id, items_13.can_reply, items_13.deleted_flag, items_13.job_id, items_13.enrichments, items_13.tags, items_13.response_template_id, items_13.retweet_of, items_13.ancestry, items_13.is_mention, items_13.originator_message_id, items_13.message_type, items_13.tagged_at, items_13.metadata, items_13.client_reply_id, items_13.selected_reply_id, items_13.uuid, items_13.switched_private, items_13.external_api_id
  • Index Cond: ((items_13.type)::text = 'Message'::text)
117. 0.000 0.000 ↓ 0.0 0

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

  • Output: sources_7.id
118. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_7 (cost=0.27..14.34 rows=58 width=4) (never executed)

  • Output: sources_7.id
  • Heap Fetches: 0
119. 0.000 0.000 ↓ 0.0 0

Hash (cost=40,466.07..40,466.07 rows=1,009,731 width=4) (never executed)

  • Output: social_profiles_3.id
120. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=38,962.80..40,466.07 rows=1,009,731 width=4) (never executed)

  • Output: social_profiles_3.id
121. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=38,962.37..38,990.97 rows=2,860 width=15) (never executed)

  • Output: client_users_12.id, client_users_13.id, custom_field_values_6.binded_key
  • Group Key: client_users_12.id
122. 0.000 0.000 ↓ 0.0 0

Gather (cost=13,221.88..38,955.22 rows=2,860 width=15) (never executed)

  • Output: client_users_12.id, client_users_13.id, custom_field_values_6.binded_key
  • Workers Planned: 3
  • Workers Launched: 0
123. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=12,221.88..37,669.22 rows=923 width=15) (never executed)

  • Output: client_users_12.id, client_users_13.id, custom_field_values_6.binded_key
  • Hash Cond: (client_users_12.id = client_users_13.id)
124. 0.000 0.000 ↓ 0.0 0

Parallel Seq Scan on public.client_users client_users_12 (cost=0.00..24,329.26 rows=422,026 width=4) (never executed)

  • Output: client_users_12.id, client_users_12.created_at, client_users_12.updated_at, client_users_12.terms_of_service, client_users_12.client_code, client_users_12.pool, client_users_12.email, client_users_12.unconfirmed_email, client_users_12.confirmation_token, client_users_12.confirmed_at, client_users_12.confirmation_sent_at, client_users_12.notifier, client_users_12.notification_token, client_users_12.notification_token_type, client_users_12.note, client_users_12.bot_routing, client_users_12.approved_at
125. 0.000 0.000 ↓ 0.0 0

Hash (cost=4,045.13..4,045.13 rows=654,140 width=11) (never executed)

  • Output: client_users_13.id, custom_field_values_6.binded_key
126. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=450.58..4,045.13 rows=654,140 width=11) (never executed)

  • Output: client_users_13.id, custom_field_values_6.binded_key
127. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=450.15..478.59 rows=2,844 width=7) (never executed)

  • Output: custom_field_values_6.binded_key
  • Group Key: (custom_field_values_6.binded_key)::integer
128. 0.000 0.000 ↓ 0.0 0

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_6 (cost=0.42..443.00 rows=2,860 width=7) (never executed)

  • Output: custom_field_values_6.binded_key, (custom_field_values_6.binded_key)::integer
  • Index Cond: (custom_field_values_6.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Filter: (custom_field_values_6.value <> 'SME'::text)
  • Heap Fetches: 0
129. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_users_pkey on public.client_users client_users_13 (cost=0.43..1.24 rows=1 width=4) (never executed)

  • Output: client_users_13.id
  • Index Cond: (client_users_13.id = (custom_field_values_6.binded_key)::integer)
  • Heap Fetches: 0
130. 0.000 0.000 ↓ 0.0 0

Index Scan using index_social_profiles_on_client_user_id on public.social_profiles social_profiles_3 (cost=0.43..0.50 rows=2 width=8) (never executed)

  • Output: social_profiles_3.client_user_id, social_profiles_3.id
  • Index Cond: (social_profiles_3.client_user_id = client_users_13.id)
131. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=90.10..449,325.34 rows=977,766 width=205) (never executed)

  • Output: items_14.id, items_14.type, items_14.ticket_id, items_14.author_type, items_14.author_id, items_14.body, items_14.created_at, items_14.updated_at
132. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=15.49..416,238.56 rows=978,190 width=205) (never executed)

  • Output: items_14.id, items_14.type, items_14.ticket_id, items_14.author_type, items_14.author_id, items_14.body, items_14.created_at, items_14.updated_at
  • Hash Cond: (items_14.source_id = sources_8.id)
133. 0.000 0.000 ↓ 0.0 0

Index Scan using test_items_authors_client_user on public.items items_14 (cost=0.43..402,406.79 rows=1,117,846 width=209) (never executed)

  • Output: items_14.id, items_14.ticket_id, items_14.source_id, items_14.author_id, items_14.external_id, items_14.body, items_14.created_at, items_14.updated_at, items_14.type, items_14.last_read_at, items_14.author_type, items_14.token, items_14.subject, items_14.external_date, items_14.satisfaction, items_14.vote, items_14.social_feedback, items_14.parent_external_id, items_14.can_reply, items_14.deleted_flag, items_14.job_id, items_14.enrichments, items_14.tags, items_14.response_template_id, items_14.retweet_of, items_14.ancestry, items_14.is_mention, items_14.originator_message_id, items_14.message_type, items_14.tagged_at, items_14.metadata, items_14.client_reply_id, items_14.selected_reply_id, items_14.uuid, items_14.switched_private, items_14.external_api_id
  • Index Cond: ((items_14.type)::text = 'Message'::text)
134. 0.000 0.000 ↓ 0.0 0

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

  • Output: sources_8.id
135. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_8 (cost=0.27..14.34 rows=58 width=4) (never executed)

  • Output: sources_8.id
  • Heap Fetches: 0
136. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=74.61..74.64 rows=1 width=15) (never executed)

  • Output: client_users_14.id, client_users_15.id, custom_field_values_7.binded_key
  • Hash Cond: (client_users_14.id = client_users_15.id)
137. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_users_pkey on public.client_users client_users_14 (cost=0.43..0.45 rows=1 width=4) (never executed)

  • Output: client_users_14.id
  • Index Cond: (client_users_14.id = items_14.author_id)
  • Heap Fetches: 0
138. 0.000 0.000 ↓ 0.0 0

Hash (cost=74.17..74.17 rows=1 width=11) (never executed)

  • Output: client_users_15.id, custom_field_values_7.binded_key
139. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=74.15..74.17 rows=1 width=11) (never executed)

  • Output: client_users_15.id, custom_field_values_7.binded_key
  • Hash Cond: (client_users_15.id = (custom_field_values_7.binded_key)::integer)
140. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_users_pkey on public.client_users client_users_15 (cost=0.43..0.45 rows=1 width=4) (never executed)

  • Output: client_users_15.id
  • Index Cond: (client_users_15.id = items_14.author_id)
  • Heap Fetches: 0
141. 0.000 0.000 ↓ 0.0 0

Hash (cost=73.55..73.55 rows=14 width=7) (never executed)

  • Output: custom_field_values_7.binded_key
142. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.custom_field_values custom_field_values_7 (cost=72.13..73.55 rows=14 width=7) (never executed)

  • Output: custom_field_values_7.binded_key
  • Recheck Cond: (((custom_field_values_7.binded_key)::integer = items_14.author_id) AND (custom_field_values_7.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid))
  • Filter: ((custom_field_values_7.deleted_at IS NULL) AND (custom_field_values_7.value <> 'SME'::text))
143. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=72.13..72.13 rows=14 width=0) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on test_cfv_binded_key_integer (cost=0.00..28.36 rows=3,725 width=0) (never executed)

  • Index Cond: ((custom_field_values_7.binded_key)::integer = items_14.author_id)
145. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on test_cfv_cf_id_and_value (cost=0.00..42.80 rows=2,863 width=0) (never executed)

  • Index Cond: (custom_field_values_7.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
146. 0.000 0.000 ↓ 0.0 0

Subquery Scan on items_15 (cost=2,900,781.26..3,044,924.06 rows=4,435,163 width=4) (never executed)

  • Output: items_15.ticket_id
147. 0.000 0.000 ↓ 0.0 0

Unique (cost=2,900,781.26..3,000,572.43 rows=4,435,163 width=1,092) (never executed)

  • Output: items_16.id, items_16.type, items_16.ticket_id, items_16.author_type, items_16.author_id, items_16.body, items_16.created_at, items_16.updated_at
148. 0.000 0.000 ↓ 0.0 0

Sort (cost=2,900,781.26..2,911,869.17 rows=4,435,163 width=1,092) (never executed)

  • Output: items_16.id, items_16.type, items_16.ticket_id, items_16.author_type, items_16.author_id, items_16.body, items_16.created_at, items_16.updated_at
  • Sort Key: items_16.id, items_16.type, items_16.ticket_id, items_16.author_type, items_16.author_id, items_16.body, items_16.created_at, items_16.updated_at
149. 0.000 0.000 ↓ 0.0 0

Append (cost=53,107.62..1,168,068.44 rows=4,435,163 width=1,092) (never executed)

150. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=53,107.62..674,391.47 rows=3,457,397 width=205) (never executed)

  • Output: items_16.id, items_16.type, items_16.ticket_id, items_16.author_type, items_16.author_id, items_16.body, items_16.created_at, items_16.updated_at
  • Hash Cond: (items_16.author_id = social_profiles_4.id)
151. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=15.49..573,756.20 rows=3,458,896 width=205) (never executed)

  • Output: items_16.id, items_16.type, items_16.ticket_id, items_16.author_type, items_16.author_id, items_16.body, items_16.created_at, items_16.updated_at
  • Hash Cond: (items_16.source_id = sources_9.id)
152. 0.000 0.000 ↓ 0.0 0

Index Scan using test_items_authors_social_profile on public.items items_16 (cost=0.43..524,885.03 rows=3,952,723 width=209) (never executed)

  • Output: items_16.id, items_16.ticket_id, items_16.source_id, items_16.author_id, items_16.external_id, items_16.body, items_16.created_at, items_16.updated_at, items_16.type, items_16.last_read_at, items_16.author_type, items_16.token, items_16.subject, items_16.external_date, items_16.satisfaction, items_16.vote, items_16.social_feedback, items_16.parent_external_id, items_16.can_reply, items_16.deleted_flag, items_16.job_id, items_16.enrichments, items_16.tags, items_16.response_template_id, items_16.retweet_of, items_16.ancestry, items_16.is_mention, items_16.originator_message_id, items_16.message_type, items_16.tagged_at, items_16.metadata, items_16.client_reply_id, items_16.selected_reply_id, items_16.uuid, items_16.switched_private, items_16.external_api_id
  • Index Cond: ((items_16.type)::text = 'Message'::text)
153. 0.000 0.000 ↓ 0.0 0

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

  • Output: sources_9.id
154. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_9 (cost=0.27..14.34 rows=58 width=4) (never executed)

  • Output: sources_9.id
  • Heap Fetches: 0
155. 0.000 0.000 ↓ 0.0 0

Hash (cost=40,470.49..40,470.49 rows=1,009,731 width=4) (never executed)

  • Output: social_profiles_4.id
156. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=38,965.63..40,470.49 rows=1,009,731 width=4) (never executed)

  • Output: social_profiles_4.id
157. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=38,965.21..38,993.84 rows=2,863 width=15) (never executed)

  • Output: client_users_16.id, client_users_17.id, custom_field_values_8.binded_key
  • Group Key: client_users_16.id
158. 0.000 0.000 ↓ 0.0 0

Gather (cost=13,224.39..38,958.05 rows=2,863 width=15) (never executed)

  • Output: client_users_16.id, client_users_17.id, custom_field_values_8.binded_key
  • Workers Planned: 3
  • Workers Launched: 0
159. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=12,224.39..37,671.75 rows=924 width=15) (never executed)

  • Output: client_users_16.id, client_users_17.id, custom_field_values_8.binded_key
  • Hash Cond: (client_users_16.id = client_users_17.id)
160. 0.000 0.000 ↓ 0.0 0

Parallel Seq Scan on public.client_users client_users_16 (cost=0.00..24,329.26 rows=422,026 width=4) (never executed)

  • Output: client_users_16.id, client_users_16.created_at, client_users_16.updated_at, client_users_16.terms_of_service, client_users_16.client_code, client_users_16.pool, client_users_16.email, client_users_16.unconfirmed_email, client_users_16.confirmation_token, client_users_16.confirmed_at, client_users_16.confirmation_sent_at, client_users_16.notifier, client_users_16.notification_token, client_users_16.notification_token_type, client_users_16.note, client_users_16.bot_routing, client_users_16.approved_at
161. 0.000 0.000 ↓ 0.0 0

Hash (cost=4,047.64..4,047.64 rows=654,140 width=11) (never executed)

  • Output: client_users_17.id, custom_field_values_8.binded_key
162. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=450.59..4,047.64 rows=654,140 width=11) (never executed)

  • Output: client_users_17.id, custom_field_values_8.binded_key
163. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=450.15..478.62 rows=2,847 width=7) (never executed)

  • Output: custom_field_values_8.binded_key
  • Group Key: (custom_field_values_8.binded_key)::integer
164. 0.000 0.000 ↓ 0.0 0

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_8 (cost=0.42..443.00 rows=2,863 width=7) (never executed)

  • Output: custom_field_values_8.binded_key, (custom_field_values_8.binded_key)::integer
  • Index Cond: (custom_field_values_8.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Filter: (custom_field_values_8.value <> 'E&O'::text)
  • Heap Fetches: 0
165. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_users_pkey on public.client_users client_users_17 (cost=0.43..1.24 rows=1 width=4) (never executed)

  • Output: client_users_17.id
  • Index Cond: (client_users_17.id = (custom_field_values_8.binded_key)::integer)
  • Heap Fetches: 0
166. 0.000 0.000 ↓ 0.0 0

Index Scan using index_social_profiles_on_client_user_id on public.social_profiles social_profiles_4 (cost=0.43..0.50 rows=2 width=8) (never executed)

  • Output: social_profiles_4.client_user_id, social_profiles_4.id
  • Index Cond: (social_profiles_4.client_user_id = client_users_17.id)
167. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=90.10..449,325.34 rows=977,766 width=205) (never executed)

  • Output: items_17.id, items_17.type, items_17.ticket_id, items_17.author_type, items_17.author_id, items_17.body, items_17.created_at, items_17.updated_at
168. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=15.49..416,238.56 rows=978,190 width=205) (never executed)

  • Output: items_17.id, items_17.type, items_17.ticket_id, items_17.author_type, items_17.author_id, items_17.body, items_17.created_at, items_17.updated_at
  • Hash Cond: (items_17.source_id = sources_10.id)
169. 0.000 0.000 ↓ 0.0 0

Index Scan using test_items_authors_client_user on public.items items_17 (cost=0.43..402,406.79 rows=1,117,846 width=209) (never executed)

  • Output: items_17.id, items_17.ticket_id, items_17.source_id, items_17.author_id, items_17.external_id, items_17.body, items_17.created_at, items_17.updated_at, items_17.type, items_17.last_read_at, items_17.author_type, items_17.token, items_17.subject, items_17.external_date, items_17.satisfaction, items_17.vote, items_17.social_feedback, items_17.parent_external_id, items_17.can_reply, items_17.deleted_flag, items_17.job_id, items_17.enrichments, items_17.tags, items_17.response_template_id, items_17.retweet_of, items_17.ancestry, items_17.is_mention, items_17.originator_message_id, items_17.message_type, items_17.tagged_at, items_17.metadata, items_17.client_reply_id, items_17.selected_reply_id, items_17.uuid, items_17.switched_private, items_17.external_api_id
  • Index Cond: ((items_17.type)::text = 'Message'::text)
170. 0.000 0.000 ↓ 0.0 0

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

  • Output: sources_10.id
171. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_10 (cost=0.27..14.34 rows=58 width=4) (never executed)

  • Output: sources_10.id
  • Heap Fetches: 0
172. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=74.61..74.64 rows=1 width=15) (never executed)

  • Output: client_users_18.id, client_users_19.id, custom_field_values_9.binded_key
  • Hash Cond: (client_users_18.id = client_users_19.id)
173. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_users_pkey on public.client_users client_users_18 (cost=0.43..0.45 rows=1 width=4) (never executed)

  • Output: client_users_18.id
  • Index Cond: (client_users_18.id = items_17.author_id)
  • Heap Fetches: 0
174. 0.000 0.000 ↓ 0.0 0

Hash (cost=74.17..74.17 rows=1 width=11) (never executed)

  • Output: client_users_19.id, custom_field_values_9.binded_key
175. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=74.15..74.17 rows=1 width=11) (never executed)

  • Output: client_users_19.id, custom_field_values_9.binded_key
  • Hash Cond: (client_users_19.id = (custom_field_values_9.binded_key)::integer)
176. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_users_pkey on public.client_users client_users_19 (cost=0.43..0.45 rows=1 width=4) (never executed)

  • Output: client_users_19.id
  • Index Cond: (client_users_19.id = items_17.author_id)
  • Heap Fetches: 0
177. 0.000 0.000 ↓ 0.0 0

Hash (cost=73.55..73.55 rows=14 width=7) (never executed)

  • Output: custom_field_values_9.binded_key
178. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.custom_field_values custom_field_values_9 (cost=72.13..73.55 rows=14 width=7) (never executed)

  • Output: custom_field_values_9.binded_key
  • Recheck Cond: (((custom_field_values_9.binded_key)::integer = items_17.author_id) AND (custom_field_values_9.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid))
  • Filter: ((custom_field_values_9.deleted_at IS NULL) AND (custom_field_values_9.value <> 'E&O'::text))
179. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=72.13..72.13 rows=14 width=0) (never executed)

180. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on test_cfv_binded_key_integer (cost=0.00..28.36 rows=3,725 width=0) (never executed)

  • Index Cond: ((custom_field_values_9.binded_key)::integer = items_17.author_id)
181. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on test_cfv_cf_id_and_value (cost=0.00..42.80 rows=2,863 width=0) (never executed)

  • Index Cond: (custom_field_values_9.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
182. 0.938 17,200.870 ↑ 516.7 8,583 1

Subquery Scan on items_18 (cost=2,894,881.94..3,039,024.74 rows=4,435,163 width=4) (actual time=17,196.622..17,200.870 rows=8,583 loops=1)

  • Output: items_18.ticket_id
  • Buffers: shared hit=9164687 read=52657
183. 1.820 17,199.932 ↑ 516.7 8,583 1

Unique (cost=2,894,881.94..2,994,673.11 rows=4,435,163 width=1,092) (actual time=17,196.619..17,199.932 rows=8,583 loops=1)

  • Output: items_19.id, items_19.type, items_19.ticket_id, items_19.author_type, items_19.author_id, items_19.body, items_19.created_at, items_19.updated_at
  • Buffers: shared hit=9164687 read=52657
184. 7.655 17,198.112 ↑ 516.7 8,583 1

Sort (cost=2,894,881.94..2,905,969.85 rows=4,435,163 width=1,092) (actual time=17,196.618..17,198.112 rows=8,583 loops=1)

  • Output: items_19.id, items_19.type, items_19.ticket_id, items_19.author_type, items_19.author_id, items_19.body, items_19.created_at, items_19.updated_at
  • Sort Key: items_19.id, items_19.type, items_19.ticket_id, items_19.author_type, items_19.author_id, items_19.body, items_19.created_at, items_19.updated_at
  • Sort Method: quicksort Memory: 2229kB
  • Buffers: shared hit=9164687 read=52657
185. 0.983 17,190.457 ↑ 516.7 8,583 1

Append (cost=47,278.00..1,162,169.12 rows=4,435,163 width=1,092) (actual time=8,813.060..17,190.457 rows=8,583 loops=1)

  • Buffers: shared hit=9164687 read=52657
186. 596.540 9,499.979 ↑ 402.8 8,583 1

Hash Semi Join (cost=47,278.00..668,561.85 rows=3,457,397 width=205) (actual time=8,813.059..9,499.979 rows=8,583 loops=1)

  • Output: items_19.id, items_19.type, items_19.ticket_id, items_19.author_type, items_19.author_id, items_19.body, items_19.created_at, items_19.updated_at
  • Hash Cond: (items_19.author_id = social_profiles_5.id)
  • Buffers: shared hit=3863331 read=44972
187. 2,420.965 8,647.958 ↓ 1.3 4,532,934 1

Hash Semi Join (cost=15.49..573,756.20 rows=3,458,896 width=205) (actual time=0.168..8,647.958 rows=4,532,934 loops=1)

  • Output: items_19.id, items_19.type, items_19.ticket_id, items_19.author_type, items_19.author_id, items_19.body, items_19.created_at, items_19.updated_at
  • Hash Cond: (items_19.source_id = sources_11.id)
  • Buffers: shared hit=3795453 read=31197
188. 6,226.889 6,226.889 ↓ 1.1 4,532,934 1

Index Scan using test_items_authors_social_profile on public.items items_19 (cost=0.43..524,885.03 rows=3,952,723 width=209) (actual time=0.042..6,226.889 rows=4,532,934 loops=1)

  • Output: items_19.id, items_19.ticket_id, items_19.source_id, items_19.author_id, items_19.external_id, items_19.body, items_19.created_at, items_19.updated_at, items_19.type, items_19.last_read_at, items_19.author_type, items_19.token, items_19.subject, items_19.external_date, items_19.satisfaction, items_19.vote, items_19.social_feedback, items_19.parent_external_id, items_19.can_reply, items_19.deleted_flag, items_19.job_id, items_19.enrichments, items_19.tags, items_19.response_template_id, items_19.retweet_of, items_19.ancestry, items_19.is_mention, items_19.originator_message_id, items_19.message_type, items_19.tagged_at, items_19.metadata, items_19.client_reply_id, items_19.selected_reply_id, items_19.uuid, items_19.switched_private, items_19.external_api_id
  • Index Cond: ((items_19.type)::text = 'Message'::text)
  • Buffers: shared hit=3795395 read=31197
189. 0.010 0.104 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.104..0.104 rows=58 loops=1)

  • Output: sources_11.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
190. 0.094 0.094 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_11 (cost=0.27..14.34 rows=58 width=4) (actual time=0.009..0.094 rows=58 loops=1)

  • Output: sources_11.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
191. 1.302 255.481 ↑ 295.0 3,423 1

Hash (cost=34,640.87..34,640.87 rows=1,009,731 width=4) (actual time=255.481..255.481 rows=3,423 loops=1)

  • Output: social_profiles_5.id
  • Buckets: 1048576 Batches: 1 Memory Usage: 8313kB
  • Buffers: shared hit=67878 read=13775
192. 1.582 254.179 ↑ 295.0 3,423 1

Nested Loop (cost=34,636.04..34,640.87 rows=1,009,731 width=4) (actual time=227.320..254.179 rows=3,423 loops=1)

  • Output: social_profiles_5.id
  • Buffers: shared hit=67878 read=13775
193. 3.131 228.636 ↓ 342.3 3,423 1

HashAggregate (cost=34,635.61..34,635.71 rows=10 width=15) (actual time=227.301..228.636 rows=3,423 loops=1)

  • Output: client_users_20.id, client_users_21.id, custom_field_values_10.binded_key
  • Group Key: client_users_20.id
  • Buffers: shared hit=54719 read=13222
194. 6.878 225.505 ↓ 342.3 3,423 1

Gather (cost=9,197.47..34,635.58 rows=10 width=15) (actual time=35.141..225.505 rows=3,423 loops=1)

  • Output: client_users_20.id, client_users_21.id, custom_field_values_10.binded_key
  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=54719 read=13222
195. 109.634 218.627 ↓ 285.3 856 4 / 4

Hash Semi Join (cost=8,197.47..33,634.58 rows=3 width=15) (actual time=46.260..218.627 rows=856 loops=4)

  • Output: client_users_20.id, client_users_21.id, custom_field_values_10.binded_key
  • Hash Cond: (client_users_20.id = client_users_21.id)
  • Buffers: shared hit=53924 read=13222
  • Worker 0: actual time=47.639..218.183 rows=859 loops=1
  • Buffers: shared hit=13505 read=3112
  • Worker 1: actual time=45.603..218.002 rows=835 loops=1
  • Buffers: shared hit=13475 read=3026
  • Worker 2: actual time=57.538..217.651 rows=634 loops=1
  • Buffers: shared hit=13078 read=2321
196. 84.244 84.244 ↑ 1.3 331,568 4 / 4

Parallel Seq Scan on public.client_users client_users_20 (cost=0.00..24,329.26 rows=422,026 width=4) (actual time=0.033..84.244 rows=331,568 loops=4)

  • Output: client_users_20.id, client_users_20.created_at, client_users_20.updated_at, client_users_20.terms_of_service, client_users_20.client_code, client_users_20.pool, client_users_20.email, client_users_20.unconfirmed_email, client_users_20.confirmation_token, client_users_20.confirmed_at, client_users_20.confirmation_sent_at, client_users_20.notifier, client_users_20.notification_token, client_users_20.notification_token_type, client_users_20.note, client_users_20.bot_routing, client_users_20.approved_at
  • Buffers: shared hit=7082 read=13027
  • Worker 0: actual time=0.037..89.482 rows=324020 loops=1
  • Buffers: shared hit=1742 read=3112
  • Worker 1: actual time=0.037..87.260 rows=306955 loops=1
  • Buffers: shared hit=1712 read=3026
  • Worker 2: actual time=0.044..79.159 rows=227188 loops=1
  • Buffers: shared hit=1315 read=2321
197. 1.208 24.749 ↑ 191.1 3,423 4 / 4

Hash (cost=20.72..20.72 rows=654,140 width=11) (actual time=24.749..24.749 rows=3,423 loops=4)

  • Output: client_users_21.id, custom_field_values_10.binded_key
  • Buckets: 1048576 Batches: 1 Memory Usage: 8340kB
  • Buffers: shared hit=46803 read=195
  • Worker 0: actual time=25.000..25.000 rows=3423 loops=1
  • Buffers: shared hit=11750
  • Worker 1: actual time=25.935..25.935 rows=3423 loops=1
  • Buffers: shared hit=11750
  • Worker 2: actual time=32.171..32.171 rows=3423 loops=1
  • Buffers: shared hit=11750
198. 1.347 23.541 ↑ 191.1 3,423 4 / 4

Nested Loop (cost=4.36..20.72 rows=654,140 width=11) (actual time=7.510..23.541 rows=3,423 loops=4)

  • Output: client_users_21.id, custom_field_values_10.binded_key
  • Buffers: shared hit=46803 read=195
  • Worker 0: actual time=7.195..23.823 rows=3423 loops=1
  • Buffers: shared hit=11750
  • Worker 1: actual time=7.715..24.599 rows=3423 loops=1
  • Buffers: shared hit=11750
  • Worker 2: actual time=10.481..30.927 rows=3423 loops=1
  • Buffers: shared hit=11750
199. 2.337 8.502 ↓ 342.3 3,423 4 / 4

HashAggregate (cost=3.92..4.02 rows=10 width=7) (actual time=7.420..8.502 rows=3,423 loops=4)

  • Output: custom_field_values_10.binded_key
  • Group Key: (custom_field_values_10.binded_key)::integer
  • Buffers: shared hit=3432 read=195
  • Worker 0: actual time=7.115..8.257 rows=3423 loops=1
  • Buffers: shared hit=907
  • Worker 1: actual time=7.572..8.793 rows=3423 loops=1
  • Buffers: shared hit=907
  • Worker 2: actual time=10.370..11.567 rows=3423 loops=1
  • Buffers: shared hit=907
200. 6.165 6.165 ↓ 342.3 3,423 4 / 4

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_10 (cost=0.42..3.90 rows=10 width=7) (actual time=0.095..6.165 rows=3,423 loops=4)

  • Output: custom_field_values_10.binded_key, (custom_field_values_10.binded_key)::integer
  • Index Cond: ((custom_field_values_10.custom_field_id = '520d1832-0834-4091-bf56-d56f5d6aa389'::uuid) AND (custom_field_values_10.value = 'Business TRE'::text))
  • Heap Fetches: 1346
  • Buffers: shared hit=3432 read=195
  • Worker 0: actual time=0.104..6.163 rows=3423 loops=1
  • Buffers: shared hit=907
  • Worker 1: actual time=0.102..6.336 rows=3423 loops=1
  • Buffers: shared hit=907
  • Worker 2: actual time=0.133..8.503 rows=3423 loops=1
  • Buffers: shared hit=907
201. 13.692 13.692 ↑ 1.0 1 13,692 / 4

Index Only Scan using client_users_pkey on public.client_users client_users_21 (cost=0.43..1.66 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=13,692)

  • Output: client_users_21.id
  • Index Cond: (client_users_21.id = (custom_field_values_10.binded_key)::integer)
  • Heap Fetches: 550
  • Buffers: shared hit=43371
  • Worker 0: actual time=0.004..0.004 rows=1 loops=3423
  • Buffers: shared hit=10843
  • Worker 1: actual time=0.004..0.004 rows=1 loops=3423
  • Buffers: shared hit=10843
  • Worker 2: actual time=0.004..0.004 rows=1 loops=3423
  • Buffers: shared hit=10843
202. 23.961 23.961 ↑ 2.0 1 3,423

Index Scan using index_social_profiles_on_client_user_id on public.social_profiles social_profiles_5 (cost=0.43..0.50 rows=2 width=8) (actual time=0.007..0.007 rows=1 loops=3,423)

  • Output: social_profiles_5.client_user_id, social_profiles_5.id
  • Index Cond: (social_profiles_5.client_user_id = client_users_21.id)
  • Buffers: shared hit=13159 read=553
203. 1,037.407 7,689.495 ↓ 0.0 0 1

Nested Loop Semi Join (cost=20.40..449,255.64 rows=977,766 width=205) (actual time=7,689.495..7,689.495 rows=0 loops=1)

  • Output: items_20.id, items_20.type, items_20.ticket_id, items_20.author_type, items_20.author_id, items_20.body, items_20.created_at, items_20.updated_at
  • Buffers: shared hit=5301356 read=7685
204. 735.624 2,818.001 ↓ 1.3 1,278,029 1

Hash Semi Join (cost=15.49..416,238.56 rows=978,190 width=205) (actual time=0.119..2,818.001 rows=1,278,029 loops=1)

  • Output: items_20.id, items_20.type, items_20.ticket_id, items_20.author_type, items_20.author_id, items_20.body, items_20.created_at, items_20.updated_at
  • Hash Cond: (items_20.source_id = sources_12.id)
  • Buffers: shared hit=1246631 read=7532
205. 2,082.314 2,082.314 ↓ 1.1 1,278,029 1

Index Scan using test_items_authors_client_user on public.items items_20 (cost=0.43..402,406.79 rows=1,117,846 width=209) (actual time=0.035..2,082.314 rows=1,278,029 loops=1)

  • Output: items_20.id, items_20.ticket_id, items_20.source_id, items_20.author_id, items_20.external_id, items_20.body, items_20.created_at, items_20.updated_at, items_20.type, items_20.last_read_at, items_20.author_type, items_20.token, items_20.subject, items_20.external_date, items_20.satisfaction, items_20.vote, items_20.social_feedback, items_20.parent_external_id, items_20.can_reply, items_20.deleted_flag, items_20.job_id, items_20.enrichments, items_20.tags, items_20.response_template_id, items_20.retweet_of, items_20.ancestry, items_20.is_mention, items_20.originator_message_id, items_20.message_type, items_20.tagged_at, items_20.metadata, items_20.client_reply_id, items_20.selected_reply_id, items_20.uuid, items_20.switched_private, items_20.external_api_id
  • Index Cond: ((items_20.type)::text = 'Message'::text)
  • Buffers: shared hit=1246573 read=7532
206. 0.013 0.063 ↑ 1.0 58 1

Hash (cost=14.34..14.34 rows=58 width=4) (actual time=0.063..0.063 rows=58 loops=1)

  • Output: sources_12.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=58
207. 0.050 0.050 ↑ 1.0 58 1

Index Only Scan using index_sources_on_id_and_workspace_id on public.sources sources_12 (cost=0.27..14.34 rows=58 width=4) (actual time=0.007..0.050 rows=58 loops=1)

  • Output: sources_12.id
  • Heap Fetches: 57
  • Buffers: shared hit=58
208. 1,278.020 3,834.087 ↓ 0.0 0 1,278,029

Hash Semi Join (cost=4.92..4.94 rows=1 width=15) (actual time=0.003..0.003 rows=0 loops=1,278,029)

  • Output: client_users_22.id, client_users_23.id, custom_field_values_11.binded_key
  • Hash Cond: (client_users_22.id = client_users_23.id)
  • Buffers: shared hit=4054725 read=153
209. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using client_users_pkey on public.client_users client_users_22 (cost=0.43..0.45 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=1)

  • Output: client_users_22.id
  • Index Cond: (client_users_22.id = items_20.author_id)
  • Heap Fetches: 0
  • Buffers: shared hit=4
210. 0.000 2,556.058 ↓ 0.0 0 1,278,029

Hash (cost=4.48..4.48 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=1,278,029)

  • Output: client_users_23.id, custom_field_values_11.binded_key
  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
  • Buffers: shared hit=4054721 read=153
211. 0.000 2,556.058 ↓ 0.0 0 1,278,029

Hash Semi Join (cost=4.45..4.48 rows=1 width=11) (actual time=0.002..0.002 rows=0 loops=1,278,029)

  • Output: client_users_23.id, custom_field_values_11.binded_key
  • Hash Cond: (client_users_23.id = (custom_field_values_11.binded_key)::integer)
  • Buffers: shared hit=4054721 read=153
212. 2,556.058 2,556.058 ↑ 1.0 1 1,278,029

Index Only Scan using client_users_pkey on public.client_users client_users_23 (cost=0.43..0.45 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,278,029)

  • Output: client_users_23.id
  • Index Cond: (client_users_23.id = items_20.author_id)
  • Heap Fetches: 213249
  • Buffers: shared hit=4053815 read=153
213. 0.821 2.733 ↓ 342.3 3,423 1

Hash (cost=3.90..3.90 rows=10 width=7) (actual time=2.733..2.733 rows=3,423 loops=1)

  • Output: custom_field_values_11.binded_key
  • Buckets: 4096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 166kB
  • Buffers: shared hit=906
214. 1.912 1.912 ↓ 342.3 3,423 1

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values custom_field_values_11 (cost=0.42..3.90 rows=10 width=7) (actual time=0.023..1.912 rows=3,423 loops=1)

  • Output: custom_field_values_11.binded_key
  • Index Cond: ((custom_field_values_11.custom_field_id = '520d1832-0834-4091-bf56-d56f5d6aa389'::uuid) AND (custom_field_values_11.value = 'Business TRE'::text))
  • Heap Fetches: 1346
  • Buffers: shared hit=906
215. 0.000 0.048 ↑ 1.0 1 8

Index Only Scan using index_items_on_source_id_and_id on public.items (cost=1.56..2.69 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=8)

  • Output: items.source_id, items.id
  • Index Cond: ((items.source_id = 44) AND (items.id = (SubPlan 1)))
  • Heap Fetches: 8
  • Buffers: shared hit=34
216.          

SubPlan (for Index Only Scan)

217. 0.008 0.080 ↑ 1.0 1 8

Limit (cost=0.43..1.12 rows=1 width=12) (actual time=0.009..0.010 rows=1 loops=8)

  • Output: items_1.id, items_1.created_at
  • Buffers: shared hit=32
218. 0.072 0.072 ↑ 13.0 1 8

Index Scan using index_items_on_ticket_id_and_created_at on public.items items_1 (cost=0.43..9.38 rows=13 width=12) (actual time=0.009..0.009 rows=1 loops=8)

  • Output: items_1.id, items_1.created_at
  • Index Cond: (items_1.ticket_id = tickets.id)
  • Filter: ((items_1.type)::text = 'Message'::text)
  • Buffers: shared hit=32
219. 0.016 0.056 ↑ 1.0 1 8

Index Only Scan using items_pkey on public.items last_message (cost=1.56..2.68 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=8)

  • Output: last_message.id
  • Index Cond: (last_message.id = (SubPlan 2))
  • Heap Fetches: 8
  • Buffers: shared hit=33
220.          

SubPlan (for Index Only Scan)

221. 0.008 0.040 ↑ 1.0 1 8

Limit (cost=0.43..1.12 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=8)

  • Output: items_2.id, items_2.created_at
  • Buffers: shared hit=32
222. 0.032 0.032 ↑ 13.0 1 8

Index Scan Backward using index_items_on_ticket_id_and_created_at on public.items items_2 (cost=0.43..9.38 rows=13 width=12) (actual time=0.004..0.004 rows=1 loops=8)

  • Output: items_2.id, items_2.created_at
  • Index Cond: (items_2.ticket_id = tickets.id)
  • Filter: ((items_2.type)::text = 'Message'::text)
  • Buffers: shared hit=32
223. 0.384 0.384 ↑ 1.0 1 8

Index Only Scan using index_sources_on_id_and_cached_label on public.sources (cost=0.27..2.48 rows=1 width=4) (actual time=0.048..0.048 rows=1 loops=8)

  • Output: sources.id, sources.cached_label
  • Index Cond: (sources.id = 44)
  • Heap Fetches: 8
  • Buffers: shared hit=25
Planning time : 144.517 ms
Execution time : 80,788.433 ms