explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GV9O

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 400,770.154 ↓ 4.7 14 1

Limit (cost=1,310,326,060.08..1,310,326,060.09 rows=3 width=950) (actual time=400,770.150..400,770.154 rows=14 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=103673 read=3882494, temp read=649596 written=648996
2. 0.053 400,770.150 ↓ 4.7 14 1

Sort (cost=1,310,326,060.08..1,310,326,060.09 rows=3 width=950) (actual time=400,770.148..400,770.150 rows=14 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: 29kB
  • Buffers: shared hit=103673 read=3882494, temp read=649596 written=648996
3. 0.047 400,770.097 ↓ 4.7 14 1

Nested Loop (cost=52,894,661.32..1,310,326,060.06 rows=3 width=950) (actual time=397,787.665..400,770.097 rows=14 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=103673 read=3882494, temp read=649596 written=648996
4. 0.326 400,768.692 ↓ 4.7 14 1

Nested Loop (cost=52,894,661.32..1,310,326,057.29 rows=3 width=954) (actual time=397,786.300..400,768.692 rows=14 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=103673 read=3882492, temp read=649596 written=648996
5. 0.659 400,768.240 ↓ 4.7 14 1

Nested Loop (cost=52,894,657.68..1,310,326,022.68 rows=3 width=954) (actual time=397,786.213..400,768.240 rows=14 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=103559 read=3882480, temp read=649596 written=648996
6. 2,418.749 400,748.051 ↑ 137.6 14 1

Index Scan using index_tickets_on_status_nulls_first on public.tickets (cost=52,894,654.04..1,310,303,796.12 rows=1,926 width=950) (actual time=397,778.332..400,748.051 rows=14 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 ((SubPlan 3) OR (SubPlan 4) OR ((SubPlan 5) AND (SubPlan 6) AND (SubPlan 7)) OR (SubPlan 8)))
  • Rows Removed by Filter: 1673
  • Buffers: shared hit=103466 read=3882447, temp read=649596 written=648996
7.          

SubPlan (for Index Scan)

8. 118.473 129,108.822 ↑ 2,904.9 1,520 1,686

Materialize (cost=8,788,429.00..8,971,255.51 rows=4,415,427 width=4) (actual time=76.506..76.577 rows=1,520 loops=1,686)

  • Output: items_3.ticket_id
  • Buffers: shared hit=18577 read=970679, temp read=162398 written=162248
9. 0.209 128,990.349 ↑ 2,904.9 1,520 1

Subquery Scan on items_3 (cost=8,788,429.00..8,931,930.37 rows=4,415,427 width=4) (actual time=128,989.408..128,990.349 rows=1,520 loops=1)

  • Output: items_3.ticket_id
  • Buffers: shared hit=18577 read=970679, temp read=162398 written=162248
10. 0.415 128,990.140 ↑ 2,904.9 1,520 1

Unique (cost=8,788,429.00..8,887,776.10 rows=4,415,427 width=1,092) (actual time=128,989.407..128,990.140 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=18577 read=970679, temp read=162398 written=162248
11. 2.619 128,989.725 ↑ 2,904.9 1,520 1

Sort (cost=8,788,429.00..8,799,467.56 rows=4,415,427 width=1,092) (actual time=128,989.404..128,989.725 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=18577 read=970679, temp read=162398 written=162248
12. 0.735 128,987.106 ↑ 2,904.9 1,520 1

Append (cost=172,532.75..1,962,539.64 rows=4,415,427 width=1,092) (actual time=48,865.671..128,987.106 rows=1,520 loops=1)

  • Buffers: shared hit=18571 read=970679, temp read=162398 written=162248
13. 69,053.805 95,135.856 ↑ 2,262.1 1,520 1

Hash Semi Join (cost=172,532.75..1,167,310.52 rows=3,438,345 width=205) (actual time=48,865.670..95,135.856 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=15108 read=573412, temp read=116913 written=116823
14. 2,135.005 17,220.567 ↓ 1.3 4,530,268 1

Hash Semi Join (cost=3.31..748,656.83 rows=3,439,491 width=205) (actual time=2.153..17,220.567 rows=4,530,268 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=13001 read=523985
15. 15,085.032 15,085.032 ↓ 1.2 4,530,268 1

Seq Scan on public.items items_4 (cost=0.00..700,065.99 rows=3,932,645 width=209) (actual time=1.606..15,085.032 rows=4,530,268 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
  • Filter: (((items_4.type)::text = 'Message'::text) AND ((items_4.author_type)::text = 'SocialProfile'::text))
  • Rows Removed by Filter: 6341865
  • Buffers: shared hit=12999 read=523985
16. 0.016 0.530 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=0.530..0.530 rows=58 loops=1)

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

Seq Scan on public.sources sources_1 (cost=0.00..2.58 rows=58 width=4) (actual time=0.505..0.514 rows=58 loops=1)

  • Output: sources_1.id
  • Buffers: shared hit=2
18. 36.063 8,861.484 ↑ 1,750.5 589 1

Hash (cost=155,613.35..155,613.35 rows=1,031,047 width=4) (actual time=8,861.484..8,861.484 rows=589 loops=1)

  • Output: social_profiles.id
  • Buckets: 131072 Batches: 16 Memory Usage: 1032kB
  • Buffers: shared hit=2107 read=49427, temp read=8678 written=8618
19. 3,870.455 8,825.421 ↑ 1,750.5 589 1

Hash Semi Join (cost=80,648.91..155,613.35 rows=1,031,047 width=4) (actual time=5,727.651..8,825.421 rows=589 loops=1)

  • Output: social_profiles.id
  • Hash Cond: (social_profiles.client_user_id = client_users_1.id)
  • Buffers: shared hit=2107 read=49427, temp read=8678 written=8618
20. 798.696 798.696 ↑ 1.0 1,539,489 1

Seq Scan on public.social_profiles (cost=0.00..44,187.89 rows=1,539,489 width=8) (actual time=0.418..798.696 rows=1,539,489 loops=1)

  • Output: social_profiles.client_user_id, social_profiles.id
  • Buffers: shared hit=3 read=28790
21. 24.266 4,156.270 ↑ 1,125.5 589 1

Hash (cost=69,125.39..69,125.39 rows=662,921 width=15) (actual time=4,156.270..4,156.270 rows=589 loops=1)

  • Output: client_users.id, client_users_1.id, custom_field_values.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1027kB
  • Buffers: shared hit=2104 read=20637, temp read=3693 written=3663
22. 2,771.923 4,132.004 ↑ 1,125.5 589 1

Hash Semi Join (cost=11,577.64..69,125.39 rows=662,921 width=15) (actual time=1,128.240..4,132.004 rows=589 loops=1)

  • 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=2104 read=20637, temp read=3693 written=3663
23. 499.649 499.649 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=1.073..499.649 rows=1,325,842 loops=1)

  • Output: client_users.id
  • Buffers: shared hit=525 read=19312
24. 21.341 860.432 ↑ 1,125.5 589 1

Hash (cost=54.13..54.13 rows=662,921 width=11) (actual time=860.432..860.432 rows=589 loops=1)

  • Output: client_users_1.id, custom_field_values.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1026kB
  • Buffers: shared hit=1579 read=1325
25. 1.572 839.091 ↑ 1,125.5 589 1

Nested Loop (cost=20.68..54.13 rows=662,921 width=11) (actual time=330.813..839.091 rows=589 loops=1)

  • Output: client_users_1.id, custom_field_values.binded_key
  • Buffers: shared hit=1579 read=1325
26. 1.339 327.445 ↓ 147.2 589 1

HashAggregate (cost=20.25..20.29 rows=4 width=7) (actual time=327.067..327.445 rows=589 loops=1)

  • Output: custom_field_values.binded_key
  • Group Key: (custom_field_values.binded_key)::integer
  • Buffers: shared hit=29 read=514
27. 326.106 326.106 ↓ 147.2 589 1

Index Only Scan using test_cfv_deleted_null_value_cf_id_binded_key on public.custom_field_values (cost=0.42..20.24 rows=4 width=7) (actual time=4.173..326.106 rows=589 loops=1)

  • 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: 589
  • Buffers: shared hit=29 read=514
28. 510.074 510.074 ↑ 1.0 1 589

Index Only Scan using client_users_pkey on public.client_users client_users_1 (cost=0.43..8.45 rows=1 width=4) (actual time=0.863..0.866 rows=1 loops=589)

  • Output: client_users_1.id
  • Index Cond: (client_users_1.id = (custom_field_values.binded_key)::integer)
  • Heap Fetches: 589
  • Buffers: shared hit=1550 read=811
29. 23,605.081 33,850.515 ↓ 0.0 0 1

Hash Semi Join (cost=111,485.64..751,074.84 rows=977,082 width=205) (actual time=33,850.515..33,850.515 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.author_id = client_users_3.id)
  • Buffers: shared hit=3463 read=397267, temp read=45485 written=45425
30. 510.852 6,496.859 ↓ 1.3 1,277,816 1

Hash Semi Join (cost=30,836.74..598,391.20 rows=977,408 width=205) (actual time=645.446..6,496.859 rows=1,277,816 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=2 read=377987
31. 5,351.102 5,984.915 ↓ 1.1 1,277,816 1

Bitmap Heap Scan on public.items items_5 (cost=30,833.43..584,580.67 rows=1,117,549 width=209) (actual time=644.320..5,984.915 rows=1,277,816 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
  • Recheck Cond: (((items_5.type)::text = 'Message'::text) AND ((items_5.author_type)::text = 'ClientUser'::text))
  • Rows Removed by Index Recheck: 5828339
  • Heap Blocks: exact=27538 lossy=344152
  • Buffers: shared read=377987
32. 633.813 633.813 ↓ 1.1 1,277,816 1

Bitmap Index Scan on test_items_authors_client_user (cost=0.00..30,554.05 rows=1,117,549 width=0) (actual time=633.813..633.813 rows=1,277,816 loops=1)

  • Index Cond: ((items_5.type)::text = 'Message'::text)
  • Buffers: shared read=6297
33. 0.023 1.092 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=1.092..1.092 rows=58 loops=1)

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

Seq Scan on public.sources sources_2 (cost=0.00..2.58 rows=58 width=4) (actual time=1.060..1.069 rows=58 loops=1)

  • Output: sources_2.id
  • Buffers: shared hit=2
35. 23.031 3,748.575 ↑ 1,125.5 589 1

Hash (cost=69,125.39..69,125.39 rows=662,921 width=15) (actual time=3,748.575..3,748.575 rows=589 loops=1)

  • Output: client_users_2.id, client_users_3.id, custom_field_values_1.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1033kB
  • Buffers: shared hit=3461 read=19280, temp read=3693 written=3663
36. 3,336.528 3,725.544 ↑ 1,125.5 589 1

Hash Semi Join (cost=11,577.64..69,125.39 rows=662,921 width=15) (actual time=255.541..3,725.544 rows=589 loops=1)

  • Output: client_users_2.id, client_users_3.id, custom_field_values_1.binded_key
  • Hash Cond: (client_users_2.id = client_users_3.id)
  • Buffers: shared hit=3461 read=19280, temp read=3693 written=3663
37. 364.485 364.485 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_2 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=2.285..364.485 rows=1,325,842 loops=1)

  • Output: client_users_2.id
  • Buffers: shared hit=557 read=19280
38. 19.917 24.531 ↑ 1,125.5 589 1

Hash (cost=54.13..54.13 rows=662,921 width=11) (actual time=24.531..24.531 rows=589 loops=1)

  • Output: client_users_3.id, custom_field_values_1.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1026kB
  • Buffers: shared hit=2904
39. 0.369 4.614 ↑ 1,125.5 589 1

Nested Loop (cost=20.68..54.13 rows=662,921 width=11) (actual time=1.931..4.614 rows=589 loops=1)

  • Output: client_users_3.id, custom_field_values_1.binded_key
  • Buffers: shared hit=2904
40. 0.548 1.889 ↓ 147.2 589 1

HashAggregate (cost=20.25..20.29 rows=4 width=7) (actual time=1.756..1.889 rows=589 loops=1)

  • Output: custom_field_values_1.binded_key
  • Group Key: (custom_field_values_1.binded_key)::integer
  • Buffers: shared hit=543
41. 1.341 1.341 ↓ 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..20.24 rows=4 width=7) (actual time=0.030..1.341 rows=589 loops=1)

  • Output: custom_field_values_1.binded_key, (custom_field_values_1.binded_key)::integer
  • 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: 589
  • Buffers: shared hit=543
42. 2.356 2.356 ↑ 1.0 1 589

Index Only Scan using client_users_pkey on public.client_users client_users_3 (cost=0.43..8.45 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=589)

  • Output: client_users_3.id
  • Index Cond: (client_users_3.id = (custom_field_values_1.binded_key)::integer)
  • Heap Fetches: 589
  • Buffers: shared hit=2361
43. 45.744 95,928.342 ↑ 7,408.4 596 1,686

Materialize (cost=8,789,411.24..8,972,237.75 rows=4,415,427 width=4) (actual time=56.870..56.897 rows=596 loops=1,686)

  • Output: items_6.ticket_id
  • Buffers: shared hit=17958 read=968152, temp read=162398 written=162248
44. 0.083 95,882.598 ↑ 7,408.4 596 1

Subquery Scan on items_6 (cost=8,789,411.24..8,932,912.62 rows=4,415,427 width=4) (actual time=95,882.281..95,882.598 rows=596 loops=1)

  • Output: items_6.ticket_id
  • Buffers: shared hit=17958 read=968152, temp read=162398 written=162248
45. 0.156 95,882.515 ↑ 7,408.4 596 1

Unique (cost=8,789,411.24..8,888,758.35 rows=4,415,427 width=1,092) (actual time=95,882.278..95,882.515 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=17958 read=968152, temp read=162398 written=162248
46. 1.208 95,882.359 ↑ 7,408.4 596 1

Sort (cost=8,789,411.24..8,800,449.81 rows=4,415,427 width=1,092) (actual time=95,882.277..95,882.359 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=17958 read=968152, temp read=162398 written=162248
47. 0.181 95,881.151 ↑ 7,408.4 596 1

Append (cost=173,023.87..1,963,521.88 rows=4,415,427 width=1,092) (actual time=50,203.257..95,881.151 rows=596 loops=1)

  • Buffers: shared hit=17958 read=968152, temp read=162398 written=162248
48. 49,107.350 64,010.190 ↑ 5,769.0 596 1

Hash Semi Join (cost=173,023.87..1,167,801.65 rows=3,438,345 width=205) (actual time=50,203.256..64,010.190 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=16347 read=570603, temp read=116913 written=116823
49. 1,596.527 8,413.607 ↓ 1.3 4,530,268 1

Hash Semi Join (cost=3.31..748,656.83 rows=3,439,491 width=205) (actual time=1.249..8,413.607 rows=4,530,268 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=15411 read=521575
50. 6,816.561 6,816.561 ↓ 1.2 4,530,268 1

Seq Scan on public.items items_7 (cost=0.00..700,065.99 rows=3,932,645 width=209) (actual time=0.677..6,816.561 rows=4,530,268 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
  • Filter: (((items_7.type)::text = 'Message'::text) AND ((items_7.author_type)::text = 'SocialProfile'::text))
  • Rows Removed by Filter: 6341865
  • Buffers: shared hit=15411 read=521573
51. 0.011 0.519 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=0.519..0.519 rows=58 loops=1)

  • Output: sources_3.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared read=2
52. 0.508 0.508 ↑ 1.0 58 1

Seq Scan on public.sources sources_3 (cost=0.00..2.58 rows=58 width=4) (actual time=0.493..0.508 rows=58 loops=1)

  • Output: sources_3.id
  • Buffers: shared read=2
53. 41.358 6,489.233 ↑ 3,776.7 273 1

Hash (cost=156,104.48..156,104.48 rows=1,031,047 width=4) (actual time=6,489.233..6,489.233 rows=273 loops=1)

  • Output: social_profiles_1.id
  • Buckets: 131072 Batches: 16 Memory Usage: 1031kB
  • Buffers: shared hit=936 read=49028, temp read=8678 written=8618
54. 3,023.141 6,447.875 ↑ 3,776.7 273 1

Hash Semi Join (cost=81,140.03..156,104.48 rows=1,031,047 width=4) (actual time=4,968.848..6,447.875 rows=273 loops=1)

  • Output: social_profiles_1.id
  • Hash Cond: (social_profiles_1.client_user_id = client_users_5.id)
  • Buffers: shared hit=936 read=49028, temp read=8678 written=8618
55. 461.170 461.170 ↑ 1.0 1,539,489 1

Seq Scan on public.social_profiles social_profiles_1 (cost=0.00..44,187.89 rows=1,539,489 width=8) (actual time=0.776..461.170 rows=1,539,489 loops=1)

  • Output: social_profiles_1.client_user_id, social_profiles_1.id
  • Buffers: shared read=28793
56. 154.441 2,963.564 ↑ 2,428.3 273 1

Hash (cost=69,616.52..69,616.52 rows=662,921 width=15) (actual time=2,963.564..2,963.564 rows=273 loops=1)

  • Output: client_users_4.id, client_users_5.id, custom_field_values_2.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1025kB
  • Buffers: shared hit=936 read=20235, temp read=3693 written=3663
57. 2,262.943 2,809.123 ↑ 2,428.3 273 1

Hash Semi Join (cost=12,068.76..69,616.52 rows=662,921 width=15) (actual time=708.750..2,809.123 rows=273 loops=1)

  • 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=936 read=20235, temp read=3693 written=3663
58. 278.257 278.257 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_4 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=0.702..278.257 rows=1,325,842 loops=1)

  • Output: client_users_4.id
  • Buffers: shared hit=242 read=19595
59. 17.871 267.923 ↑ 2,428.3 273 1

Hash (cost=545.25..545.25 rows=662,921 width=11) (actual time=267.923..267.923 rows=273 loops=1)

  • Output: client_users_5.id, custom_field_values_2.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1025kB
  • Buffers: shared hit=694 read=640
60. 0.590 250.052 ↑ 2,428.3 273 1

Nested Loop (cost=173.00..545.25 rows=662,921 width=11) (actual time=158.125..250.052 rows=273 loops=1)

  • Output: client_users_5.id, custom_field_values_2.binded_key
  • Buffers: shared hit=694 read=640
61. 0.595 156.369 ↓ 6.2 273 1

HashAggregate (cost=172.57..173.01 rows=44 width=7) (actual time=156.209..156.369 rows=273 loops=1)

  • Output: custom_field_values_2.binded_key
  • Group Key: (custom_field_values_2.binded_key)::integer
  • Buffers: shared read=241
62. 153.695 155.774 ↓ 6.2 273 1

Bitmap Heap Scan on public.custom_field_values custom_field_values_2 (cost=4.88..172.46 rows=44 width=7) (actual time=3.178..155.774 rows=273 loops=1)

  • Output: custom_field_values_2.binded_key, (custom_field_values_2.binded_key)::integer
  • Recheck Cond: ((custom_field_values_2.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_2.value = ''::text) AND (custom_field_values_2.deleted_at IS NULL))
  • Heap Blocks: exact=237
  • Buffers: shared read=241
63. 2.079 2.079 ↓ 6.2 273 1

Bitmap Index Scan on test_cfv_deleted_null_value_cf_id_binded_key (cost=0.00..4.87 rows=44 width=0) (actual time=2.079..2.079 rows=273 loops=1)

  • Index Cond: ((custom_field_values_2.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_2.value = ''::text))
  • Buffers: shared read=4
64. 93.093 93.093 ↑ 1.0 1 273

Index Only Scan using client_users_pkey on public.client_users client_users_5 (cost=0.43..8.45 rows=1 width=4) (actual time=0.341..0.341 rows=1 loops=273)

  • Output: client_users_5.id
  • Index Cond: (client_users_5.id = (custom_field_values_2.binded_key)::integer)
  • Heap Fetches: 273
  • Buffers: shared hit=694 read=399
65. 23,434.020 31,870.780 ↓ 0.0 0 1

Hash Semi Join (cost=111,976.77..751,565.96 rows=977,082 width=205) (actual time=31,870.780..31,870.780 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
  • Hash Cond: (items_8.author_id = client_users_7.id)
  • Buffers: shared hit=1611 read=397549, temp read=45485 written=45425
66. 460.212 5,250.309 ↓ 1.3 1,277,816 1

Hash Semi Join (cost=30,836.74..598,391.20 rows=977,408 width=205) (actual time=328.107..5,250.309 rows=1,277,816 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=3 read=377986
67. 4,469.754 4,788.841 ↓ 1.1 1,277,816 1

Bitmap Heap Scan on public.items items_8 (cost=30,833.43..584,580.67 rows=1,117,549 width=209) (actual time=326.573..4,788.841 rows=1,277,816 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
  • Recheck Cond: (((items_8.type)::text = 'Message'::text) AND ((items_8.author_type)::text = 'ClientUser'::text))
  • Rows Removed by Index Recheck: 5828339
  • Heap Blocks: exact=27538 lossy=344152
  • Buffers: shared hit=1 read=377986
68. 319.087 319.087 ↓ 1.1 1,277,816 1

Bitmap Index Scan on test_items_authors_client_user (cost=0.00..30,554.05 rows=1,117,549 width=0) (actual time=319.087..319.087 rows=1,277,816 loops=1)

  • Index Cond: ((items_8.type)::text = 'Message'::text)
  • Buffers: shared read=6297
69. 0.013 1.256 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=1.256..1.256 rows=58 loops=1)

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

Seq Scan on public.sources sources_4 (cost=0.00..2.58 rows=58 width=4) (actual time=1.232..1.243 rows=58 loops=1)

  • Output: sources_4.id
  • Buffers: shared hit=2
71. 34.968 3,186.451 ↑ 2,428.3 273 1

Hash (cost=69,616.52..69,616.52 rows=662,921 width=15) (actual time=3,186.451..3,186.451 rows=273 loops=1)

  • Output: client_users_6.id, client_users_7.id, custom_field_values_3.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1031kB
  • Buffers: shared hit=1608 read=19563, temp read=3693 written=3663
72. 2,813.806 3,151.483 ↑ 2,428.3 273 1

Hash Semi Join (cost=12,068.76..69,616.52 rows=662,921 width=15) (actual time=508.342..3,151.483 rows=273 loops=1)

  • 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=1608 read=19563, temp read=3693 written=3663
73. 307.842 307.842 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_6 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=6.487..307.842 rows=1,325,842 loops=1)

  • Output: client_users_6.id
  • Buffers: shared hit=274 read=19563
74. 27.929 29.835 ↑ 2,428.3 273 1

Hash (cost=545.25..545.25 rows=662,921 width=11) (actual time=29.835..29.835 rows=273 loops=1)

  • Output: client_users_7.id, custom_field_values_3.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1025kB
  • Buffers: shared hit=1334
75. 0.267 1.906 ↑ 2,428.3 273 1

Nested Loop (cost=173.00..545.25 rows=662,921 width=11) (actual time=0.678..1.906 rows=273 loops=1)

  • Output: client_users_7.id, custom_field_values_3.binded_key
  • Buffers: shared hit=1334
76. 0.261 0.820 ↓ 6.2 273 1

HashAggregate (cost=172.57..173.01 rows=44 width=7) (actual time=0.661..0.820 rows=273 loops=1)

  • Output: custom_field_values_3.binded_key
  • Group Key: (custom_field_values_3.binded_key)::integer
  • Buffers: shared hit=241
77. 0.480 0.559 ↓ 6.2 273 1

Bitmap Heap Scan on public.custom_field_values custom_field_values_3 (cost=4.88..172.46 rows=44 width=7) (actual time=0.116..0.559 rows=273 loops=1)

  • Output: custom_field_values_3.binded_key, (custom_field_values_3.binded_key)::integer
  • Recheck Cond: ((custom_field_values_3.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_3.value = ''::text) AND (custom_field_values_3.deleted_at IS NULL))
  • Heap Blocks: exact=237
  • Buffers: shared hit=241
78. 0.079 0.079 ↓ 6.2 273 1

Bitmap Index Scan on test_cfv_deleted_null_value_cf_id_binded_key (cost=0.00..4.87 rows=44 width=0) (actual time=0.079..0.079 rows=273 loops=1)

  • Index Cond: ((custom_field_values_3.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid) AND (custom_field_values_3.value = ''::text))
  • Buffers: shared hit=4
79. 0.819 0.819 ↑ 1.0 1 273

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

  • Output: client_users_7.id
  • Index Cond: (client_users_7.id = (custom_field_values_3.binded_key)::integer)
  • Heap Fetches: 273
  • Buffers: shared hit=1093
80. 269.334 86,559.240 ↑ 1,351.1 3,268 1,686

Materialize (cost=8,842,748.52..9,025,575.03 rows=4,415,427 width=4) (actual time=51.179..51.340 rows=3,268 loops=1,686)

  • Output: items_9.ticket_id
  • Buffers: shared hit=22791 read=970995, temp read=162398 written=162248
81. 0.412 86,289.906 ↑ 1,351.1 3,268 1

Subquery Scan on items_9 (cost=8,842,748.52..8,986,249.90 rows=4,415,427 width=4) (actual time=86,288.245..86,289.906 rows=3,268 loops=1)

  • Output: items_9.ticket_id
  • Buffers: shared hit=22791 read=970995, temp read=162398 written=162248
82. 0.811 86,289.494 ↑ 1,351.1 3,268 1

Unique (cost=8,842,748.52..8,942,095.63 rows=4,415,427 width=1,092) (actual time=86,288.242..86,289.494 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=22791 read=970995, temp read=162398 written=162248
83. 4.341 86,288.683 ↑ 1,351.1 3,268 1

Sort (cost=8,842,748.52..8,853,787.09 rows=4,415,427 width=1,092) (actual time=86,288.241..86,288.683 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=22791 read=970995, temp read=162398 written=162248
84. 0.619 86,284.342 ↑ 1,351.1 3,268 1

Append (cost=199,692.51..2,016,859.16 rows=4,415,427 width=1,092) (actual time=20,243.273..86,284.342 rows=3,268 loops=1)

  • Buffers: shared hit=22791 read=970995, temp read=162398 written=162248
85. 44,500.389 58,624.272 ↑ 1,052.1 3,268 1

Hash Semi Join (cost=199,692.51..1,194,470.28 rows=3,438,345 width=205) (actual time=20,243.273..58,624.272 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=16730 read=574058, temp read=116913 written=116823
86. 1,565.334 7,884.381 ↓ 1.3 4,530,268 1

Hash Semi Join (cost=3.31..748,656.83 rows=3,439,491 width=205) (actual time=1.592..7,884.381 rows=4,530,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.source_id = sources_5.id)
  • Buffers: shared hit=13377 read=523609
87. 6,318.426 6,318.426 ↓ 1.2 4,530,268 1

Seq Scan on public.items items_10 (cost=0.00..700,065.99 rows=3,932,645 width=209) (actual time=0.950..6,318.426 rows=4,530,268 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
  • Filter: (((items_10.type)::text = 'Message'::text) AND ((items_10.author_type)::text = 'SocialProfile'::text))
  • Rows Removed by Filter: 6341865
  • Buffers: shared hit=13377 read=523607
88. 0.013 0.621 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=0.621..0.621 rows=58 loops=1)

  • Output: sources_5.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared read=2
89. 0.608 0.608 ↑ 1.0 58 1

Seq Scan on public.sources sources_5 (cost=0.00..2.58 rows=58 width=4) (actual time=0.597..0.608 rows=58 loops=1)

  • Output: sources_5.id
  • Buffers: shared read=2
90. 33.322 6,239.502 ↑ 1,077.4 957 1

Hash (cost=182,773.11..182,773.11 rows=1,031,047 width=4) (actual time=6,239.502..6,239.502 rows=957 loops=1)

  • Output: social_profiles_2.id
  • Buckets: 131072 Batches: 16 Memory Usage: 1032kB
  • Buffers: shared hit=3353 read=50449, temp read=8678 written=8618
91. 3,073.274 6,206.180 ↑ 1,077.4 957 1

Hash Semi Join (cost=107,808.67..182,773.11 rows=1,031,047 width=4) (actual time=4,170.164..6,206.180 rows=957 loops=1)

  • Output: social_profiles_2.id
  • Hash Cond: (social_profiles_2.client_user_id = client_users_9.id)
  • Buffers: shared hit=3353 read=50449, temp read=8678 written=8618
92. 485.109 485.109 ↑ 1.0 1,539,489 1

Seq Scan on public.social_profiles social_profiles_2 (cost=0.00..44,187.89 rows=1,539,489 width=8) (actual time=0.839..485.109 rows=1,539,489 loops=1)

  • Output: social_profiles_2.client_user_id, social_profiles_2.id
  • Buffers: shared read=28793
93. 15.525 2,647.797 ↑ 692.7 957 1

Hash (cost=96,285.15..96,285.15 rows=662,921 width=15) (actual time=2,647.797..2,647.797 rows=957 loops=1)

  • Output: client_users_8.id, client_users_9.id, custom_field_values_4.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1027kB
  • Buffers: shared hit=3353 read=21656, temp read=3693 written=3663
94. 1,968.029 2,632.272 ↑ 692.7 957 1

Hash Semi Join (cost=38,737.40..96,285.15 rows=662,921 width=15) (actual time=808.768..2,632.272 rows=957 loops=1)

  • 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=3353 read=21656, temp read=3693 written=3663
95. 226.073 226.073 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_8 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=0.616..226.073 rows=1,325,842 loops=1)

  • Output: client_users_8.id
  • Buffers: shared hit=854 read=18983
96. 17.924 438.170 ↑ 692.7 957 1

Hash (cost=27,213.89..27,213.89 rows=662,921 width=11) (actual time=438.170..438.170 rows=957 loops=1)

  • Output: client_users_9.id, custom_field_values_4.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1027kB
  • Buffers: shared hit=2499 read=2673
97. 0.946 420.246 ↑ 692.7 957 1

Nested Loop (cost=6,365.71..27,213.89 rows=662,921 width=11) (actual time=357.721..420.246 rows=957 loops=1)

  • Output: client_users_9.id, custom_field_values_4.binded_key
  • Buffers: shared hit=2499 read=2673
98. 2.248 358.052 ↑ 3.1 957 1

HashAggregate (cost=6,365.28..6,394.91 rows=2,963 width=7) (actual time=357.668..358.052 rows=957 loops=1)

  • Output: custom_field_values_4.binded_key
  • Group Key: (custom_field_values_4.binded_key)::integer
  • Buffers: shared hit=1 read=1341
99. 350.456 355.804 ↑ 3.1 957 1

Bitmap Heap Scan on public.custom_field_values custom_field_values_4 (cost=83.53..6,357.83 rows=2,981 width=7) (actual time=5.581..355.804 rows=957 loops=1)

  • Output: custom_field_values_4.binded_key, (custom_field_values_4.binded_key)::integer
  • Recheck Cond: (custom_field_values_4.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Filter: ((custom_field_values_4.deleted_at IS NULL) AND (custom_field_values_4.value <> 'Large'::text))
  • Rows Removed by Filter: 691
  • Heap Blocks: exact=1331
  • Buffers: shared hit=1 read=1341
100. 5.348 5.348 ↑ 1.8 1,648 1

Bitmap Index Scan on index_custom_field_values_on_custom_field_id_and_binded_key (cost=0.00..82.78 rows=2,981 width=0) (actual time=5.348..5.348 rows=1,648 loops=1)

  • Index Cond: (custom_field_values_4.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Buffers: shared read=11
101. 61.248 61.248 ↑ 1.0 1 957

Index Only Scan using client_users_pkey on public.client_users client_users_9 (cost=0.43..7.02 rows=1 width=4) (actual time=0.064..0.064 rows=1 loops=957)

  • Output: client_users_9.id
  • Index Cond: (client_users_9.id = (custom_field_values_4.binded_key)::integer)
  • Heap Fetches: 957
  • Buffers: shared hit=2498 read=1332
102. 19,108.661 27,659.451 ↓ 0.0 0 1

Hash Semi Join (cost=138,645.40..778,234.60 rows=977,082 width=205) (actual time=27,659.451..27,659.451 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
  • Hash Cond: (items_11.author_id = client_users_11.id)
  • Buffers: shared hit=6061 read=396937, temp read=45485 written=45425
103. 545.635 5,909.070 ↓ 1.3 1,277,816 1

Hash Semi Join (cost=30,836.74..598,391.20 rows=977,408 width=205) (actual time=316.456..5,909.070 rows=1,277,816 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=3 read=377986
104. 5,056.353 5,362.778 ↓ 1.1 1,277,816 1

Bitmap Heap Scan on public.items items_11 (cost=30,833.43..584,580.67 rows=1,117,549 width=209) (actual time=315.766..5,362.778 rows=1,277,816 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
  • Recheck Cond: (((items_11.type)::text = 'Message'::text) AND ((items_11.author_type)::text = 'ClientUser'::text))
  • Rows Removed by Index Recheck: 5828339
  • Heap Blocks: exact=27538 lossy=344152
  • Buffers: shared hit=1 read=377986
105. 306.425 306.425 ↓ 1.1 1,277,816 1

Bitmap Index Scan on test_items_authors_client_user (cost=0.00..30,554.05 rows=1,117,549 width=0) (actual time=306.425..306.425 rows=1,277,816 loops=1)

  • Index Cond: ((items_11.type)::text = 'Message'::text)
  • Buffers: shared read=6297
106. 0.015 0.657 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=0.657..0.657 rows=58 loops=1)

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

Seq Scan on public.sources sources_6 (cost=0.00..2.58 rows=58 width=4) (actual time=0.632..0.642 rows=58 loops=1)

  • Output: sources_6.id
  • Buffers: shared hit=2
108. 13.997 2,641.720 ↑ 692.7 957 1

Hash (cost=96,285.15..96,285.15 rows=662,921 width=15) (actual time=2,641.720..2,641.720 rows=957 loops=1)

  • Output: client_users_10.id, client_users_11.id, custom_field_values_5.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1033kB
  • Buffers: shared hit=6058 read=18951, temp read=3693 written=3663
109. 2,258.016 2,627.723 ↑ 692.7 957 1

Hash Semi Join (cost=38,737.40..96,285.15 rows=662,921 width=15) (actual time=444.586..2,627.723 rows=957 loops=1)

  • 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=6058 read=18951, temp read=3693 written=3663
110. 321.197 321.197 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_10 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=0.650..321.197 rows=1,325,842 loops=1)

  • Output: client_users_10.id
  • Buffers: shared hit=886 read=18951
111. 28.350 48.510 ↑ 692.7 957 1

Hash (cost=27,213.89..27,213.89 rows=662,921 width=11) (actual time=48.510..48.510 rows=957 loops=1)

  • Output: client_users_11.id, custom_field_values_5.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1027kB
  • Buffers: shared hit=5172
112. 0.979 20.160 ↑ 692.7 957 1

Nested Loop (cost=6,365.71..27,213.89 rows=662,921 width=11) (actual time=11.110..20.160 rows=957 loops=1)

  • Output: client_users_11.id, custom_field_values_5.binded_key
  • Buffers: shared hit=5172
113. 1.061 11.525 ↑ 3.1 957 1

HashAggregate (cost=6,365.28..6,394.91 rows=2,963 width=7) (actual time=11.044..11.525 rows=957 loops=1)

  • Output: custom_field_values_5.binded_key
  • Group Key: (custom_field_values_5.binded_key)::integer
  • Buffers: shared hit=1342
114. 10.139 10.464 ↑ 3.1 957 1

Bitmap Heap Scan on public.custom_field_values custom_field_values_5 (cost=83.53..6,357.83 rows=2,981 width=7) (actual time=0.515..10.464 rows=957 loops=1)

  • Output: custom_field_values_5.binded_key, (custom_field_values_5.binded_key)::integer
  • Recheck Cond: (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))
  • Rows Removed by Filter: 691
  • Heap Blocks: exact=1331
  • Buffers: shared hit=1342
115. 0.325 0.325 ↑ 1.8 1,648 1

Bitmap Index Scan on index_custom_field_values_on_custom_field_id_and_binded_key (cost=0.00..82.78 rows=2,981 width=0) (actual time=0.325..0.325 rows=1,648 loops=1)

  • Index Cond: (custom_field_values_5.custom_field_id = '5138c474-51e6-4cbe-b0b7-63a2186f3340'::uuid)
  • Buffers: shared hit=11
116. 7.656 7.656 ↑ 1.0 1 957

Index Only Scan using client_users_pkey on public.client_users client_users_11 (cost=0.43..7.02 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=957)

  • Output: client_users_11.id
  • Index Cond: (client_users_11.id = (custom_field_values_5.binded_key)::integer)
  • Heap Fetches: 957
  • Buffers: shared hit=3830
117. 0.000 0.000 ↓ 0.0 0

Materialize (cost=8,842,713.68..9,025,540.19 rows=4,415,427 width=4) (never executed)

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

Subquery Scan on items_12 (cost=8,842,713.68..8,986,215.06 rows=4,415,427 width=4) (never executed)

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

Unique (cost=8,842,713.68..8,942,060.79 rows=4,415,427 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
120. 0.000 0.000 ↓ 0.0 0

Sort (cost=8,842,713.68..8,853,752.25 rows=4,415,427 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
121. 0.000 0.000 ↓ 0.0 0

Append (cost=199,675.09..2,016,824.32 rows=4,415,427 width=1,092) (never executed)

122. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=199,675.09..1,194,452.87 rows=3,438,345 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)
123. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=3.31..748,656.83 rows=3,439,491 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)
124. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.items items_13 (cost=0.00..700,065.99 rows=3,932,645 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
  • Filter: (((items_13.type)::text = 'Message'::text) AND ((items_13.author_type)::text = 'SocialProfile'::text))
125. 0.000 0.000 ↓ 0.0 0

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

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

Seq Scan on public.sources sources_7 (cost=0.00..2.58 rows=58 width=4) (never executed)

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

Hash (cost=182,755.70..182,755.70 rows=1,031,047 width=4) (never executed)

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

Hash Semi Join (cost=107,791.25..182,755.70 rows=1,031,047 width=4) (never executed)

  • Output: social_profiles_3.id
  • Hash Cond: (social_profiles_3.client_user_id = client_users_13.id)
129. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.social_profiles social_profiles_3 (cost=0.00..44,187.89 rows=1,539,489 width=8) (never executed)

  • Output: social_profiles_3.client_user_id, social_profiles_3.id
130. 0.000 0.000 ↓ 0.0 0

Hash (cost=96,267.74..96,267.74 rows=662,921 width=15) (never executed)

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

Hash Semi Join (cost=38,719.99..96,267.74 rows=662,921 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)
132. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.client_users client_users_12 (cost=0.00..33,095.42 rows=1,325,842 width=4) (never executed)

  • Output: client_users_12.id
133. 0.000 0.000 ↓ 0.0 0

Hash (cost=27,196.47..27,196.47 rows=662,921 width=11) (never executed)

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

Nested Loop (cost=6,365.71..27,196.47 rows=662,921 width=11) (never executed)

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

HashAggregate (cost=6,365.27..6,394.87 rows=2,960 width=7) (never executed)

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

Bitmap Heap Scan on public.custom_field_values custom_field_values_6 (cost=83.53..6,357.83 rows=2,978 width=7) (never executed)

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

Bitmap Index Scan on index_custom_field_values_on_custom_field_id_and_binded_key (cost=0.00..82.78 rows=2,981 width=0) (never executed)

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

Index Only Scan using client_users_pkey on public.client_users client_users_13 (cost=0.43..7.02 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
139. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=138,627.99..778,217.18 rows=977,082 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.author_id = client_users_15.id)
140. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=30,836.74..598,391.20 rows=977,408 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)
141. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.items items_14 (cost=30,833.43..584,580.67 rows=1,117,549 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
  • Recheck Cond: (((items_14.type)::text = 'Message'::text) AND ((items_14.author_type)::text = 'ClientUser'::text))
142. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on test_items_authors_client_user (cost=0.00..30,554.05 rows=1,117,549 width=0) (never executed)

  • Index Cond: ((items_14.type)::text = 'Message'::text)
143. 0.000 0.000 ↓ 0.0 0

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

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

Seq Scan on public.sources sources_8 (cost=0.00..2.58 rows=58 width=4) (never executed)

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

Hash (cost=96,267.74..96,267.74 rows=662,921 width=15) (never executed)

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

Hash Semi Join (cost=38,719.99..96,267.74 rows=662,921 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)
147. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.client_users client_users_14 (cost=0.00..33,095.42 rows=1,325,842 width=4) (never executed)

  • Output: client_users_14.id
148. 0.000 0.000 ↓ 0.0 0

Hash (cost=27,196.47..27,196.47 rows=662,921 width=11) (never executed)

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

Nested Loop (cost=6,365.71..27,196.47 rows=662,921 width=11) (never executed)

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

HashAggregate (cost=6,365.27..6,394.87 rows=2,960 width=7) (never executed)

  • Output: custom_field_values_7.binded_key
  • Group Key: (custom_field_values_7.binded_key)::integer
151. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.custom_field_values custom_field_values_7 (cost=83.53..6,357.83 rows=2,978 width=7) (never executed)

  • Output: custom_field_values_7.binded_key, (custom_field_values_7.binded_key)::integer
  • Recheck Cond: (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))
152. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_custom_field_values_on_custom_field_id_and_binded_key (cost=0.00..82.78 rows=2,981 width=0) (never executed)

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

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

  • Output: client_users_15.id
  • Index Cond: (client_users_15.id = (custom_field_values_7.binded_key)::integer)
  • Heap Fetches: 0
154. 0.000 0.000 ↓ 0.0 0

Materialize (cost=8,842,748.52..9,025,575.03 rows=4,415,427 width=4) (never executed)

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

Subquery Scan on items_15 (cost=8,842,748.52..8,986,249.90 rows=4,415,427 width=4) (never executed)

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

Unique (cost=8,842,748.52..8,942,095.63 rows=4,415,427 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
157. 0.000 0.000 ↓ 0.0 0

Sort (cost=8,842,748.52..8,853,787.09 rows=4,415,427 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
158. 0.000 0.000 ↓ 0.0 0

Append (cost=199,692.51..2,016,859.16 rows=4,415,427 width=1,092) (never executed)

159. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=199,692.51..1,194,470.28 rows=3,438,345 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)
160. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=3.31..748,656.83 rows=3,439,491 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)
161. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.items items_16 (cost=0.00..700,065.99 rows=3,932,645 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
  • Filter: (((items_16.type)::text = 'Message'::text) AND ((items_16.author_type)::text = 'SocialProfile'::text))
162. 0.000 0.000 ↓ 0.0 0

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

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

Seq Scan on public.sources sources_9 (cost=0.00..2.58 rows=58 width=4) (never executed)

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

Hash (cost=182,773.11..182,773.11 rows=1,031,047 width=4) (never executed)

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

Hash Semi Join (cost=107,808.67..182,773.11 rows=1,031,047 width=4) (never executed)

  • Output: social_profiles_4.id
  • Hash Cond: (social_profiles_4.client_user_id = client_users_17.id)
166. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.social_profiles social_profiles_4 (cost=0.00..44,187.89 rows=1,539,489 width=8) (never executed)

  • Output: social_profiles_4.client_user_id, social_profiles_4.id
167. 0.000 0.000 ↓ 0.0 0

Hash (cost=96,285.15..96,285.15 rows=662,921 width=15) (never executed)

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

Hash Semi Join (cost=38,737.40..96,285.15 rows=662,921 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)
169. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.client_users client_users_16 (cost=0.00..33,095.42 rows=1,325,842 width=4) (never executed)

  • Output: client_users_16.id
170. 0.000 0.000 ↓ 0.0 0

Hash (cost=27,213.89..27,213.89 rows=662,921 width=11) (never executed)

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

Nested Loop (cost=6,365.71..27,213.89 rows=662,921 width=11) (never executed)

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

HashAggregate (cost=6,365.28..6,394.91 rows=2,963 width=7) (never executed)

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

Bitmap Heap Scan on public.custom_field_values custom_field_values_8 (cost=83.53..6,357.83 rows=2,981 width=7) (never executed)

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

Bitmap Index Scan on index_custom_field_values_on_custom_field_id_and_binded_key (cost=0.00..82.78 rows=2,981 width=0) (never executed)

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

Index Only Scan using client_users_pkey on public.client_users client_users_17 (cost=0.43..7.02 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
176. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=138,645.40..778,234.60 rows=977,082 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.author_id = client_users_19.id)
177. 0.000 0.000 ↓ 0.0 0

Hash Semi Join (cost=30,836.74..598,391.20 rows=977,408 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)
178. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.items items_17 (cost=30,833.43..584,580.67 rows=1,117,549 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
  • Recheck Cond: (((items_17.type)::text = 'Message'::text) AND ((items_17.author_type)::text = 'ClientUser'::text))
179. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on test_items_authors_client_user (cost=0.00..30,554.05 rows=1,117,549 width=0) (never executed)

  • Index Cond: ((items_17.type)::text = 'Message'::text)
180. 0.000 0.000 ↓ 0.0 0

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

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

Seq Scan on public.sources sources_10 (cost=0.00..2.58 rows=58 width=4) (never executed)

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

Hash (cost=96,285.15..96,285.15 rows=662,921 width=15) (never executed)

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

Hash Semi Join (cost=38,737.40..96,285.15 rows=662,921 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)
184. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.client_users client_users_18 (cost=0.00..33,095.42 rows=1,325,842 width=4) (never executed)

  • Output: client_users_18.id
185. 0.000 0.000 ↓ 0.0 0

Hash (cost=27,213.89..27,213.89 rows=662,921 width=11) (never executed)

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

Nested Loop (cost=6,365.71..27,213.89 rows=662,921 width=11) (never executed)

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

HashAggregate (cost=6,365.28..6,394.91 rows=2,963 width=7) (never executed)

  • Output: custom_field_values_9.binded_key
  • Group Key: (custom_field_values_9.binded_key)::integer
188. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on public.custom_field_values custom_field_values_9 (cost=83.53..6,357.83 rows=2,981 width=7) (never executed)

  • Output: custom_field_values_9.binded_key, (custom_field_values_9.binded_key)::integer
  • Recheck Cond: (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))
189. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on index_custom_field_values_on_custom_field_id_and_binded_key (cost=0.00..82.78 rows=2,981 width=0) (never executed)

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

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

  • Output: client_users_19.id
  • Index Cond: (client_users_19.id = (custom_field_values_9.binded_key)::integer)
  • Heap Fetches: 0
191. 656.587 86,732.898 ↑ 517.4 8,534 1,686

Materialize (cost=8,788,602.66..8,971,429.17 rows=4,415,427 width=4) (actual time=51.051..51.443 rows=8,534 loops=1,686)

  • Output: items_18.ticket_id
  • Buffers: shared hit=44033 read=971243, temp read=162402 written=162252
192. 1.104 86,076.311 ↑ 517.4 8,534 1

Subquery Scan on items_18 (cost=8,788,602.66..8,932,104.04 rows=4,415,427 width=4) (actual time=86,072.323..86,076.311 rows=8,534 loops=1)

  • Output: items_18.ticket_id
  • Buffers: shared hit=44033 read=971243, temp read=162402 written=162252
193. 1.803 86,075.207 ↑ 517.4 8,534 1

Unique (cost=8,788,602.66..8,887,949.77 rows=4,415,427 width=1,092) (actual time=86,072.321..86,075.207 rows=8,534 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=44033 read=971243, temp read=162402 written=162252
194. 8.759 86,073.404 ↑ 517.4 8,534 1

Sort (cost=8,788,602.66..8,799,641.23 rows=4,415,427 width=1,092) (actual time=86,072.320..86,073.404 rows=8,534 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: 2219kB
  • Buffers: shared hit=44033 read=971243, temp read=162402 written=162252
195. 1.455 86,064.645 ↑ 517.4 8,534 1

Append (cost=172,619.58..1,962,713.30 rows=4,415,427 width=1,092) (actual time=17,986.671..86,064.645 rows=8,534 loops=1)

  • Buffers: shared hit=44033 read=971243, temp read=162402 written=162252
196. 47,677.321 61,890.329 ↑ 402.9 8,534 1

Hash Semi Join (cost=172,619.58..1,167,397.35 rows=3,438,345 width=205) (actual time=17,986.670..61,890.329 rows=8,534 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=25242 read=576291, temp read=116915 written=116825
197. 1,536.412 8,083.695 ↓ 1.3 4,530,268 1

Hash Semi Join (cost=3.31..748,656.83 rows=3,439,491 width=205) (actual time=1.448..8,083.695 rows=4,530,268 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=11268 read=525718
198. 6,546.558 6,546.558 ↓ 1.2 4,530,268 1

Seq Scan on public.items items_19 (cost=0.00..700,065.99 rows=3,932,645 width=209) (actual time=0.684..6,546.558 rows=4,530,268 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
  • Filter: (((items_19.type)::text = 'Message'::text) AND ((items_19.author_type)::text = 'SocialProfile'::text))
  • Rows Removed by Filter: 6341865
  • Buffers: shared hit=11268 read=525716
199. 0.015 0.725 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=0.725..0.725 rows=58 loops=1)

  • Output: sources_11.id
  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared read=2
200. 0.710 0.710 ↑ 1.0 58 1

Seq Scan on public.sources sources_11 (cost=0.00..2.58 rows=58 width=4) (actual time=0.702..0.710 rows=58 loops=1)

  • Output: sources_11.id
  • Buffers: shared read=2
201. 31.522 6,129.313 ↑ 302.8 3,405 1

Hash (cost=155,700.18..155,700.18 rows=1,031,047 width=4) (actual time=6,129.313..6,129.313 rows=3,405 loops=1)

  • Output: social_profiles_5.id
  • Buckets: 131072 Batches: 16 Memory Usage: 1037kB
  • Buffers: shared hit=13974 read=50573, temp read=8680 written=8620
202. 3,207.478 6,097.791 ↑ 302.8 3,405 1

Hash Semi Join (cost=80,735.74..155,700.18 rows=1,031,047 width=4) (actual time=4,487.953..6,097.791 rows=3,405 loops=1)

  • Output: social_profiles_5.id
  • Hash Cond: (social_profiles_5.client_user_id = client_users_21.id)
  • Buffers: shared hit=13974 read=50573, temp read=8680 written=8620
203. 463.771 463.771 ↑ 1.0 1,539,489 1

Seq Scan on public.social_profiles social_profiles_5 (cost=0.00..44,187.89 rows=1,539,489 width=8) (actual time=0.508..463.771 rows=1,539,489 loops=1)

  • Output: social_profiles_5.client_user_id, social_profiles_5.id
  • Buffers: shared read=28793
204. 19.246 2,426.542 ↑ 194.7 3,405 1

Hash (cost=69,212.22..69,212.22 rows=662,921 width=15) (actual time=2,426.541..2,426.542 rows=3,405 loops=1)

  • Output: client_users_20.id, client_users_21.id, custom_field_values_10.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1034kB
  • Buffers: shared hit=13974 read=21780, temp read=3693 written=3665
205. 1,577.381 2,407.296 ↑ 194.7 3,405 1

Hash Semi Join (cost=11,664.47..69,212.22 rows=662,921 width=15) (actual time=611.095..2,407.296 rows=3,405 loops=1)

  • 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=13974 read=21780, temp read=3693 written=3663
206. 241.236 241.236 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_20 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=0.624..241.236 rows=1,325,842 loops=1)

  • Output: client_users_20.id
  • Buffers: shared hit=2839 read=16998
207. 25.272 588.679 ↑ 194.7 3,405 1

Hash (cost=140.96..140.96 rows=662,921 width=11) (actual time=588.679..588.679 rows=3,405 loops=1)

  • Output: client_users_21.id, custom_field_values_10.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1033kB
  • Buffers: shared hit=11135 read=4782
208. 2.133 563.407 ↑ 194.7 3,405 1

Nested Loop (cost=48.22..140.96 rows=662,921 width=11) (actual time=397.282..563.407 rows=3,405 loops=1)

  • Output: client_users_21.id, custom_field_values_10.binded_key
  • Buffers: shared hit=11135 read=4782
209. 5.799 397.834 ↓ 309.5 3,405 1

HashAggregate (cost=47.79..47.90 rows=11 width=7) (actual time=396.179..397.834 rows=3,405 loops=1)

  • Output: custom_field_values_10.binded_key
  • Group Key: (custom_field_values_10.binded_key)::integer
  • Buffers: shared hit=633 read=1642
210. 392.035 392.035 ↓ 309.5 3,405 1

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..47.76 rows=11 width=7) (actual time=1.653..392.035 rows=3,405 loops=1)

  • 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: 3405
  • Buffers: shared hit=633 read=1642
211. 163.440 163.440 ↑ 1.0 1 3,405

Index Only Scan using client_users_pkey on public.client_users client_users_21 (cost=0.43..8.45 rows=1 width=4) (actual time=0.047..0.048 rows=1 loops=3,405)

  • Output: client_users_21.id
  • Index Cond: (client_users_21.id = (custom_field_values_10.binded_key)::integer)
  • Heap Fetches: 3405
  • Buffers: shared hit=10502 read=3140
212. 16,659.092 24,172.861 ↓ 0.0 0 1

Hash Semi Join (cost=111,572.47..751,161.67 rows=977,082 width=205) (actual time=24,172.861..24,172.861 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
  • Hash Cond: (items_20.author_id = client_users_23.id)
  • Buffers: shared hit=18791 read=394952, temp read=45487 written=45427
213. 461.095 4,961.950 ↓ 1.3 1,277,816 1

Hash Semi Join (cost=30,836.74..598,391.20 rows=977,408 width=205) (actual time=284.066..4,961.950 rows=1,277,816 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=3 read=377986
214. 4,222.698 4,500.007 ↓ 1.1 1,277,816 1

Bitmap Heap Scan on public.items items_20 (cost=30,833.43..584,580.67 rows=1,117,549 width=209) (actual time=283.182..4,500.007 rows=1,277,816 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
  • Recheck Cond: (((items_20.type)::text = 'Message'::text) AND ((items_20.author_type)::text = 'ClientUser'::text))
  • Rows Removed by Index Recheck: 5828339
  • Heap Blocks: exact=27538 lossy=344152
  • Buffers: shared hit=1 read=377986
215. 277.309 277.309 ↓ 1.1 1,277,816 1

Bitmap Index Scan on test_items_authors_client_user (cost=0.00..30,554.05 rows=1,117,549 width=0) (actual time=277.308..277.309 rows=1,277,816 loops=1)

  • Index Cond: ((items_20.type)::text = 'Message'::text)
  • Buffers: shared read=6297
216. 0.012 0.848 ↑ 1.0 58 1

Hash (cost=2.58..2.58 rows=58 width=4) (actual time=0.848..0.848 rows=58 loops=1)

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

Seq Scan on public.sources sources_12 (cost=0.00..2.58 rows=58 width=4) (actual time=0.820..0.836 rows=58 loops=1)

  • Output: sources_12.id
  • Buffers: shared hit=2
218. 18.791 2,551.819 ↑ 194.7 3,405 1

Hash (cost=69,212.22..69,212.22 rows=662,921 width=15) (actual time=2,551.819..2,551.819 rows=3,405 loops=1)

  • Output: client_users_22.id, client_users_23.id, custom_field_values_11.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1040kB
  • Buffers: shared hit=18788 read=16966, temp read=3693 written=3665
219. 2,250.772 2,533.028 ↑ 194.7 3,405 1

Hash Semi Join (cost=11,664.47..69,212.22 rows=662,921 width=15) (actual time=73.021..2,533.028 rows=3,405 loops=1)

  • 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=18788 read=16966, temp read=3693 written=3663
220. 246.353 246.353 ↑ 1.0 1,325,842 1

Seq Scan on public.client_users client_users_22 (cost=0.00..33,095.42 rows=1,325,842 width=4) (actual time=6.967..246.353 rows=1,325,842 loops=1)

  • Output: client_users_22.id
  • Buffers: shared hit=2871 read=16966
221. 19.573 35.903 ↑ 194.7 3,405 1

Hash (cost=140.96..140.96 rows=662,921 width=11) (actual time=35.903..35.903 rows=3,405 loops=1)

  • Output: client_users_23.id, custom_field_values_11.binded_key
  • Buckets: 131072 Batches: 16 Memory Usage: 1033kB
  • Buffers: shared hit=15917
222. 0.617 16.330 ↑ 194.7 3,405 1

Nested Loop (cost=48.22..140.96 rows=662,921 width=11) (actual time=4.805..16.330 rows=3,405 loops=1)

  • Output: client_users_23.id, custom_field_values_11.binded_key
  • Buffers: shared hit=15917
223. 2.002 5.498 ↓ 309.5 3,405 1

HashAggregate (cost=47.79..47.90 rows=11 width=7) (actual time=4.789..5.498 rows=3,405 loops=1)

  • Output: custom_field_values_11.binded_key
  • Group Key: (custom_field_values_11.binded_key)::integer
  • Buffers: shared hit=2275
224. 3.496 3.496 ↓ 309.5 3,405 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..47.76 rows=11 width=7) (actual time=0.080..3.496 rows=3,405 loops=1)

  • Output: custom_field_values_11.binded_key, (custom_field_values_11.binded_key)::integer
  • 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: 3405
  • Buffers: shared hit=2275
225. 10.215 10.215 ↑ 1.0 1 3,405

Index Only Scan using client_users_pkey on public.client_users client_users_23 (cost=0.43..8.45 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=3,405)

  • Output: client_users_23.id
  • Index Cond: (client_users_23.id = (custom_field_values_11.binded_key)::integer)
  • Heap Fetches: 3405
  • Buffers: shared hit=13642
226. 19.040 19.530 ↑ 1.0 1 14

Index Scan using items_pkey on public.items (cost=3.64..11.53 rows=1 width=8) (actual time=1.394..1.395 rows=1 loops=14)

  • Output: items.id, items.ticket_id, items.source_id, items.author_id, items.external_id, items.body, items.created_at, items.updated_at, items.type, items.last_read_at, items.author_type, items.token, items.subject, items.external_date, items.satisfaction, items.vote, items.social_feedback, items.parent_external_id, items.can_reply, items.deleted_flag, items.job_id, items.enrichments, items.tags, items.response_template_id, items.retweet_of, items.ancestry, items.is_mention, items.originator_message_id, items.message_type, items.tagged_at, items.metadata, items.client_reply_id, items.selected_reply_id, items.uuid, items.switched_private, items.external_api_id
  • Index Cond: (items.id = (SubPlan 1))
  • Filter: (items.source_id = 44)
  • Buffers: shared hit=44 read=12
227.          

SubPlan (for Index Scan)

228. 0.028 0.490 ↑ 1.0 1 14

Limit (cost=0.56..3.21 rows=1 width=12) (actual time=0.034..0.035 rows=1 loops=14)

  • Output: items_1.id, items_1.created_at
  • Buffers: shared hit=49 read=21
229. 0.462 0.462 ↑ 12.0 1 14

Index Scan using index_items_on_ticket_id_and_created_at on public.items items_1 (cost=0.56..32.31 rows=12 width=12) (actual time=0.033..0.033 rows=1 loops=14)

  • 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=49 read=21
230. 0.000 0.126 ↑ 1.0 1 14

Index Only Scan using items_pkey on public.items last_message (cost=3.64..11.53 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=14)

  • Output: last_message.id
  • Index Cond: (last_message.id = (SubPlan 2))
  • Heap Fetches: 14
  • Buffers: shared hit=53 read=3
231.          

SubPlan (for Index Only Scan)

232. 0.070 0.252 ↑ 1.0 1 14

Limit (cost=0.56..3.21 rows=1 width=12) (actual time=0.017..0.018 rows=1 loops=14)

  • Output: items_2.id, items_2.created_at
  • Buffers: shared hit=61 read=9
233. 0.182 0.182 ↑ 12.0 1 14

Index Scan Backward using index_items_on_ticket_id_and_created_at on public.items items_2 (cost=0.56..32.31 rows=12 width=12) (actual time=0.013..0.013 rows=1 loops=14)

  • 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=61 read=9
234. 0.017 1.358 ↑ 1.0 1 14

Materialize (cost=0.00..2.73 rows=1 width=4) (actual time=0.096..0.097 rows=1 loops=14)

  • Output: sources.id
  • Buffers: shared read=2
235. 1.341 1.341 ↑ 1.0 1 1

Seq Scan on public.sources (cost=0.00..2.73 rows=1 width=4) (actual time=1.331..1.341 rows=1 loops=1)

  • Output: sources.id
  • Filter: (sources.id = 44)
  • Rows Removed by Filter: 57
  • Buffers: shared read=2
Planning time : 840.087 ms
Execution time : 400,778.086 ms