explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9Lzr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=225,630.93..225,630.93 rows=1 width=1,118) (never executed)

2. 0.000 0.000 ↓ 0.0

Sort (cost=225,630.93..225,630.93 rows=1 width=1,118) (never executed)

  • Sort Key: q1.parent_team, q1.team, (concat(users_3.first_name, ' ', users_3.last_name)), ios_1.name
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=206,862.95..225,630.92 rows=1 width=1,118) (never executed)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=172,609.83..191,377.71 rows=1 width=894) (never executed)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=137,878.72..156,385.92 rows=1 width=798) (never executed)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=103,188.76..121,690.52 rows=1 width=702) (never executed)

7. 0.000 0.000 ↓ 0.0

Aggregate (cost=34,717.39..34,813.43 rows=5,488 width=192) (never executed)

8. 0.000 0.000 ↓ 0.0

Hash Join (cost=33,767.69..34,552.75 rows=5,488 width=120) (never executed)

9. 0.000 0.000 ↓ 0.0

Unique (cost=33,388.75..34,061.03 rows=5,488 width=522) (never executed)

10. 0.000 0.000 ↓ 0.0

Sort (cost=33,388.75..33,402.47 rows=5,488 width=522) (never executed)

  • Sort Key: ios.io_number, ios.id, ios.external_io_number, ios.name, deals.closed_at, advertiser.id, advertiser.name, agency.id, agency.name, ios.budget, ios.budget_loc, ios.curr_cd, ios.start_date, ios.end_date, users.id, (concat(users.first_name, ' ', users.last_name)), io_members.share, (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((ios.budget)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios.budget * (io_members.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((ios.budget_loc)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios.budget_loc * (io_members.share)::numeric) / '100'::numeric))::double precision END), io_members.from_date, io_members.to_date, ios.updated_at, display_line_items.id, display_line_items.line_number, display_line_items.ad_server, display_line_items.start_date, display_line_items.end_date, dis_prod.id, dis_prod.full_name, dis_prod_fam.name, (CASE WHEN (dis_parent_product.name IS NULL) THEN dis_prod.full_name ELSE dis_parent_product.name END), dis_sub_prod_1.name, dis_sub_prod_2.name, dis_prod.revenue_type, product_pricing_type.product_pricing_type, display_line_items.ad_unit, display_line_items.ad_server_product, display_line_items.quantity, display_line_items.price, display_line_items.pricing_type, (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((display_line_items.budget)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items.budget * (io_members.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((display_line_items.budget_delivered)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items.budget_delivered * (io_members.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((display_line_items.budget_remaining)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items.budget_remaining * (io_members.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((display_line_items.budget_loc)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items.budget_loc * (io_members.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((display_line_items.budget_delivered_loc)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items.budget_delivered_loc * (io_members.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members.to_date <> ios.end_date) OR (io_members.from_date <> ios.start_date)) THEN (((((display_line_items.budget_remaining_loc)::double precision * ((io_members.to_date - io_members.from_date))::double precision) / NULLIF((((ios.end_date - ios.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items.budget_remaining_loc * (io_members.share)::numeric) / '100'::numeric))::double precision END), display_line_items.quantity_delivered, display_line_items.quantity_remaining
11. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,723.34..33,047.89 rows=5,488 width=522) (never executed)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,449.49..30,818.94 rows=5,488 width=440) (never executed)

13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,786.89..30,108.51 rows=5,488 width=424) (never executed)

14. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,786.6..27,593.46 rows=3,790 width=408) (never executed)

15. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,848.42..26,317.19 rows=3,790 width=376) (never executed)

16. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,833.24..26,260.58 rows=3,790 width=368) (never executed)

17. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,832.65..20,058.91 rows=3,790 width=356) (never executed)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,112.76..19,293.84 rows=3,790 width=344) (never executed)

19. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.88..18,537.79 rows=3,790 width=285) (never executed)

20. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.45..13,270.3 rows=3,790 width=277) (never executed)

21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.03..8,873.37 rows=3,790 width=262) (never executed)

22. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,391.61..4,476.44 rows=3,790 width=247) (never executed)

23. 0.000 0.000 ↓ 0.0

Index Scan using index_display_line_items_on_io_id on display_line_items display_line_items (cost=0.29..3,429.17 rows=57,592 width=165) (never executed)

24. 0.000 0.000 ↓ 0.0

Sort (cost=2,391.3..2,406.92 rows=6,250 width=90) (never executed)

  • Sort Key: ios.id
25. 0.000 0.000 ↓ 0.0

Index Scan using index_ios_on_company_id on ios ios (cost=0.42..1,997.25 rows=6,250 width=90) (never executed)

  • Index Cond: (company_id = 115)
26. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients advertiser (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios.advertiser_id)
27. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients agency (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios.agency_id)
28. 0.000 0.000 ↓ 0.0

Index Scan using deals_pkey on deals deals (cost=0.42..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = ios.io_number)
29. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=67) (never executed)

30. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_prod (cost=0..531.06 rows=15,106 width=67) (never executed)

31. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=20) (never executed)

32. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_parent_product (cost=0..531.06 rows=15,106 width=20) (never executed)

33. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on products dis_sub_prod_1 (cost=0.59..1.63 rows=1 width=20) (never executed)

  • Filter: (level = 1)
34. 0.000 0.000 ↓ 0.0

BitmapOr (cost=0.59..0.59 rows=2 width=0) (never executed)

35. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod.parent_id)
36. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod.id)
37. 0.000 0.000 ↓ 0.0

Hash (cost=10.08..10.08 rows=408 width=16) (never executed)

38. 0.000 0.000 ↓ 0.0

Seq Scan on product_families dis_prod_fam (cost=0..10.08 rows=408 width=16) (never executed)

39. 0.000 0.000 ↓ 0.0

Hash (cost=929.54..929.54 rows=691 width=36) (never executed)

40. 0.000 0.000 ↓ 0.0

Subquery Scan on product_pricing_type (cost=915.72..929.54 rows=691 width=36) (never executed)

41. 0.000 0.000 ↓ 0.0

Aggregate (cost=915.72..922.63 rows=691 width=36) (never executed)

42. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.25..912.26 rows=692 width=16) (never executed)

43. 0.000 0.000 ↓ 0.0

Hash Join (cost=90.44..591.25 rows=692 width=25) (never executed)

44. 0.000 0.000 ↓ 0.0

Index Scan using index_values_on_company_id_subject_type on values values (cost=0.43..498.42 rows=692 width=12) (never executed)

  • Index Cond: ((company_id = 115) AND ((subject_type)::text = 'Product'::text))
45. 0.000 0.000 ↓ 0.0

Hash (cost=88.53..88.53 rows=119 width=17) (never executed)

46. 0.000 0.000 ↓ 0.0

Seq Scan on fields f (cost=0..88.53 rows=119 width=17) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((name)::text = 'Pricing Type'::text))
47. 0.000 0.000 ↓ 0.0

Hash (cost=205.39..205.39 rows=7,361 width=20) (never executed)

48. 0.000 0.000 ↓ 0.0

Seq Scan on options product_pricing_type_options (cost=0..205.39 rows=7,361 width=20) (never executed)

  • Filter: (deleted_at IS NULL)
49. 0.000 0.000 ↓ 0.0

Index Scan using index_io_members_on_io_id_user_id on io_members io_members (cost=0.29..0.64 rows=2 width=20) (never executed)

  • Index Cond: (ios.id = io_id)
50. 0.000 0.000 ↓ 0.0

Hash (cost=568.83..568.83 rows=7,502 width=20) (never executed)

51. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_sub_prod_2 (cost=0..568.83 rows=7,502 width=20) (never executed)

  • Filter: (level = 2)
52. 0.000 0.000 ↓ 0.0

Hash (cost=220.6..220.6 rows=4,260 width=17) (never executed)

53. 0.000 0.000 ↓ 0.0

Seq Scan on users users (cost=0..220.6 rows=4,260 width=17) (never executed)

54. 0.000 0.000 ↓ 0.0

Hash (cost=377.25..377.25 rows=136 width=68) (never executed)

55. 0.000 0.000 ↓ 0.0

Subquery Scan on q1_1 (cost=370.11..377.25 rows=136 width=68) (never executed)

56. 0.000 0.000 ↓ 0.0

Unique (cost=370.11..375.89 rows=136 width=325) (never executed)

57. 0.000 0.000 ↓ 0.0

Sort (cost=370.11..370.45 rows=136 width=325) (never executed)

  • Sort Key: users_1.id, users_1.email, (concat(users_1.first_name, ' ', users_1.last_name)), (CASE WHEN (leader_team.name IS NULL) THEN 'No'::text ELSE 'Yes'::text END), (CASE WHEN (leader_team.name IS NULL) THEN child_team.name ELSE leader_team.name END), (CASE WHEN (leader_parent_team.name IS NULL) THEN parent_team.name ELSE leader_parent_team.name END), (CASE WHEN (leader_parent_team.name IS NULL) THEN concat(parent_team_lead_users.first_name, ' ', parent_team_lead_users.last_name) ELSE concat(leader_parent_team_lead_users.first_name, ' ', leader_parent_team_lead_users.last_name) END), users_1.title, (CASE WHEN users_1.is_active THEN 'Active'::text ELSE 'Inactive'::text END), (CASE WHEN (users_1.user_type = 0) THEN 'Default'::text WHEN (users_1.user_type = 1) THEN 'Seller'::text WHEN (users_1.user_type = 2) THEN 'Sales Manager'::text WHEN (users_1.user_type = 3) THEN 'Account Manager'::text WHEN (users_1.user_type = 4) THEN 'Manager Account Manager'::text WHEN (users_1.user_type = 5) THEN 'Admin'::text WHEN (users_1.user_type = 6) THEN 'Exec'::text ELSE 'Fake User'::text END), users_1.employee_id, users_1.office, users_1.default_currency, assignment_name.assignment_name, (date(users_1.last_sign_in_at)), ((('now'::cstring)::date - date(users_1.last_sign_in_at)))
58. 0.000 0.000 ↓ 0.0

Hash Join (cost=195.42..365.29 rows=136 width=325) (never executed)

59. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.76..354.01 rows=136 width=161) (never executed)

60. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.48..287.04 rows=136 width=152) (never executed)

61. 0.000 0.000 ↓ 0.0

Hash Join (cost=189.2..220.07 rows=136 width=143) (never executed)

62. 0.000 0.000 ↓ 0.0

Seq Scan on teams parent_team (cost=0..24.58 rows=1,058 width=20) (never executed)

63. 0.000 0.000 ↓ 0.0

Hash (cost=187.5..187.5 rows=136 width=131) (never executed)

64. 0.000 0.000 ↓ 0.0

Hash Join (cost=155.55..187.5 rows=136 width=131) (never executed)

65. 0.000 0.000 ↓ 0.0

Hash Join (cost=117.74..148.61 rows=136 width=119) (never executed)

66. 0.000 0.000 ↓ 0.0

Seq Scan on teams leader_parent_team (cost=0..24.58 rows=1,058 width=20) (never executed)

67. 0.000 0.000 ↓ 0.0

Hash (cost=116.04..116.04 rows=136 width=107) (never executed)

68. 0.000 0.000 ↓ 0.0

Merge Join (cost=98.75..116.04 rows=136 width=107) (never executed)

69. 0.000 0.000 ↓ 0.0

Index Scan using index_teams_on_leader_id on teams leader_team (cost=0.28..37.15 rows=1,058 width=20) (never executed)

70. 0.000 0.000 ↓ 0.0

Sort (cost=98.48..98.82 rows=136 width=91) (never executed)

  • Sort Key: users_1.id
71. 0.000 0.000 ↓ 0.0

Index Scan using index_users_on_company_id on users users_1 (cost=0.28..93.66 rows=136 width=91) (never executed)

  • Index Cond: (company_id = 115)
  • Filter: (((email)::text <> 'success@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostrcrm.com'::text) AND ((email)::text <> 'success2@boostr.com'::text) AND ((email)::text <> 'success3@boostr.com'::text) AND ((email)::text <> 'success4@boostr.com'::text) AND ((email)::text <> 'success5@boostr.com'::text) AND ((email)::text <> 'support@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostr.com'::text))
72. 0.000 0.000 ↓ 0.0

Hash (cost=24.58..24.58 rows=1,058 width=20) (never executed)

73. 0.000 0.000 ↓ 0.0

Seq Scan on teams child_team (cost=0..24.58 rows=1,058 width=20) (never executed)

74. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users leader_parent_team_lead_users (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = leader_parent_team.leader_id)
75. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users parent_team_lead_users (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = parent_team.leader_id)
76. 0.000 0.000 ↓ 0.0

Hash (cost=5.65..5.65 rows=1 width=36) (never executed)

77. 0.000 0.000 ↓ 0.0

Subquery Scan on assignment_name (cost=5.63..5.65 rows=1 width=36) (never executed)

78. 0.000 0.000 ↓ 0.0

Unique (cost=5.63..5.64 rows=1 width=36) (never executed)

79. 0.000 0.000 ↓ 0.0

Sort (cost=5.63..5.63 rows=1 width=36) (never executed)

  • Sort Key: users_2.id, (btrim(string_agg(assignment_rules.name, ', '::text), ', '::text))
80. 0.000 0.000 ↓ 0.0

Aggregate (cost=5.58..5.62 rows=1 width=36) (never executed)

81. 0.000 0.000 ↓ 0.0

Unique (cost=5.58..5.59 rows=1 width=13) (never executed)

82. 0.000 0.000 ↓ 0.0

Sort (cost=5.58..5.58 rows=1 width=13) (never executed)

  • Sort Key: users_2.id, assignment_rules.name
83. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..5.57 rows=1 width=13) (never executed)

84. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4.33 rows=1 width=13) (never executed)

85. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_on_company_id on assignment_rules assignment_rules (cost=0.14..2.16 rows=1 width=13) (never executed)

  • Index Cond: (company_id = 115)
86. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_users_on_assignment_rule_id on assignment_rules_users assignment_rules_users (cost=0.14..2.16 rows=1 width=8) (never executed)

  • Index Cond: (assignment_rule_id = assignment_rules.id)
87. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users users_2 (cost=0.28..1.23 rows=1 width=4) (never executed)

  • Index Cond: (id = assignment_rules_users.user_id)
  • Filter: (company_id = 115)
88. 0.000 0.000 ↓ 0.0

Materialize (cost=68,471.37..82,322.15 rows=41 width=606) (never executed)

89. 0.000 0.000 ↓ 0.0

Nested Loop (cost=68,471.37..82,321.95 rows=41 width=606) (never executed)

90. 0.000 0.000 ↓ 0.0

Hash Join (cost=33,767.69..34,552.75 rows=5,488 width=510) (never executed)

91. 0.000 0.000 ↓ 0.0

Unique (cost=33,388.75..34,061.03 rows=5,488 width=522) (never executed)

92. 0.000 0.000 ↓ 0.0

Sort (cost=33,388.75..33,402.47 rows=5,488 width=522) (never executed)

  • Sort Key: ios_1.io_number, ios_1.id, ios_1.external_io_number, ios_1.name, deals_1.closed_at, advertiser_1.id, advertiser_1.name, agency_1.id, agency_1.name, ios_1.budget, ios_1.budget_loc, ios_1.curr_cd, ios_1.start_date, ios_1.end_date, users_3.id, (concat(users_3.first_name, ' ', users_3.last_name)), io_members_1.share, (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((ios_1.budget)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_1.budget * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((ios_1.budget_loc)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_1.budget_loc * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), io_members_1.from_date, io_members_1.to_date, ios_1.updated_at, display_line_items_1.id, display_line_items_1.line_number, display_line_items_1.ad_server, display_line_items_1.start_date, display_line_items_1.end_date, dis_prod_1.id, dis_prod_1.full_name, dis_prod_fam_1.name, (CASE WHEN (dis_parent_product_1.name IS NULL) THEN dis_prod_1.full_name ELSE dis_parent_product_1.name END), dis_sub_prod_1_1.name, dis_sub_prod_2_1.name, dis_prod_1.revenue_type, product_pricing_type_1.product_pricing_type, display_line_items_1.ad_unit, display_line_items_1.ad_server_product, display_line_items_1.quantity, display_line_items_1.price, display_line_items_1.pricing_type, (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((display_line_items_1.budget)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_1.budget * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((display_line_items_1.budget_delivered)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_1.budget_delivered * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((display_line_items_1.budget_remaining)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_1.budget_remaining * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((display_line_items_1.budget_loc)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_1.budget_loc * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((display_line_items_1.budget_delivered_loc)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_1.budget_delivered_loc * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_1.to_date <> ios_1.end_date) OR (io_members_1.from_date <> ios_1.start_date)) THEN (((((display_line_items_1.budget_remaining_loc)::double precision * ((io_members_1.to_date - io_members_1.from_date))::double precision) / NULLIF((((ios_1.end_date - ios_1.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_1.budget_remaining_loc * (io_members_1.share)::numeric) / '100'::numeric))::double precision END), display_line_items_1.quantity_delivered, display_line_items_1.quantity_remaining
93. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,723.34..33,047.89 rows=5,488 width=522) (never executed)

94. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,449.49..30,818.94 rows=5,488 width=440) (never executed)

95. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,786.89..30,108.51 rows=5,488 width=424) (never executed)

96. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,786.6..27,593.46 rows=3,790 width=408) (never executed)

97. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,848.42..26,317.19 rows=3,790 width=376) (never executed)

98. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,833.24..26,260.58 rows=3,790 width=368) (never executed)

99. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,832.65..20,058.91 rows=3,790 width=356) (never executed)

100. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,112.76..19,293.84 rows=3,790 width=344) (never executed)

101. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.88..18,537.79 rows=3,790 width=285) (never executed)

102. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.45..13,270.3 rows=3,790 width=277) (never executed)

103. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.03..8,873.37 rows=3,790 width=262) (never executed)

104. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,391.61..4,476.44 rows=3,790 width=247) (never executed)

105. 0.000 0.000 ↓ 0.0

Index Scan using index_display_line_items_on_io_id on display_line_items display_line_items_1 (cost=0.29..3,429.17 rows=57,592 width=165) (never executed)

106. 0.000 0.000 ↓ 0.0

Sort (cost=2,391.3..2,406.92 rows=6,250 width=90) (never executed)

  • Sort Key: ios_1.id
107. 0.000 0.000 ↓ 0.0

Index Scan using index_ios_on_company_id on ios ios_1 (cost=0.42..1,997.25 rows=6,250 width=90) (never executed)

  • Index Cond: (company_id = 115)
108. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients advertiser_1 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_1.advertiser_id)
109. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients agency_1 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_1.agency_id)
110. 0.000 0.000 ↓ 0.0

Index Scan using deals_pkey on deals deals_1 (cost=0.42..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = ios_1.io_number)
111. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=67) (never executed)

112. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_prod_1 (cost=0..531.06 rows=15,106 width=67) (never executed)

113. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=20) (never executed)

114. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_parent_product_1 (cost=0..531.06 rows=15,106 width=20) (never executed)

115. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on products dis_sub_prod_1_1 (cost=0.59..1.63 rows=1 width=20) (never executed)

  • Filter: (level = 1)
116. 0.000 0.000 ↓ 0.0

BitmapOr (cost=0.59..0.59 rows=2 width=0) (never executed)

117. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_1.parent_id)
118. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_1.id)
119. 0.000 0.000 ↓ 0.0

Hash (cost=10.08..10.08 rows=408 width=16) (never executed)

120. 0.000 0.000 ↓ 0.0

Seq Scan on product_families dis_prod_fam_1 (cost=0..10.08 rows=408 width=16) (never executed)

121. 0.000 0.000 ↓ 0.0

Hash (cost=929.54..929.54 rows=691 width=36) (never executed)

122. 0.000 0.000 ↓ 0.0

Subquery Scan on product_pricing_type_1 (cost=915.72..929.54 rows=691 width=36) (never executed)

123. 0.000 0.000 ↓ 0.0

Aggregate (cost=915.72..922.63 rows=691 width=36) (never executed)

124. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.25..912.26 rows=692 width=16) (never executed)

125. 0.000 0.000 ↓ 0.0

Hash Join (cost=90.44..591.25 rows=692 width=25) (never executed)

126. 0.000 0.000 ↓ 0.0

Index Scan using index_values_on_company_id_subject_type on values values_1 (cost=0.43..498.42 rows=692 width=12) (never executed)

  • Index Cond: ((company_id = 115) AND ((subject_type)::text = 'Product'::text))
127. 0.000 0.000 ↓ 0.0

Hash (cost=88.53..88.53 rows=119 width=17) (never executed)

128. 0.000 0.000 ↓ 0.0

Seq Scan on fields f_1 (cost=0..88.53 rows=119 width=17) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((name)::text = 'Pricing Type'::text))
129. 0.000 0.000 ↓ 0.0

Hash (cost=205.39..205.39 rows=7,361 width=20) (never executed)

130. 0.000 0.000 ↓ 0.0

Seq Scan on options product_pricing_type_options_1 (cost=0..205.39 rows=7,361 width=20) (never executed)

  • Filter: (deleted_at IS NULL)
131. 0.000 0.000 ↓ 0.0

Index Scan using index_io_members_on_io_id_user_id on io_members io_members_1 (cost=0.29..0.64 rows=2 width=20) (never executed)

  • Index Cond: (ios_1.id = io_id)
132. 0.000 0.000 ↓ 0.0

Hash (cost=568.83..568.83 rows=7,502 width=20) (never executed)

133. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_sub_prod_2_1 (cost=0..568.83 rows=7,502 width=20) (never executed)

  • Filter: (level = 2)
134. 0.000 0.000 ↓ 0.0

Hash (cost=220.6..220.6 rows=4,260 width=17) (never executed)

135. 0.000 0.000 ↓ 0.0

Seq Scan on users users_3 (cost=0..220.6 rows=4,260 width=17) (never executed)

136. 0.000 0.000 ↓ 0.0

Hash (cost=377.25..377.25 rows=136 width=100) (never executed)

137. 0.000 0.000 ↓ 0.0

Subquery Scan on q1 (cost=370.11..377.25 rows=136 width=100) (never executed)

138. 0.000 0.000 ↓ 0.0

Unique (cost=370.11..375.89 rows=136 width=325) (never executed)

139. 0.000 0.000 ↓ 0.0

Sort (cost=370.11..370.45 rows=136 width=325) (never executed)

  • Sort Key: users_4.id, users_4.email, (concat(users_4.first_name, ' ', users_4.last_name)), (CASE WHEN (leader_team_1.name IS NULL) THEN 'No'::text ELSE 'Yes'::text END), (CASE WHEN (leader_team_1.name IS NULL) THEN child_team_1.name ELSE leader_team_1.name END), (CASE WHEN (leader_parent_team_1.name IS NULL) THEN parent_team_1.name ELSE leader_parent_team_1.name END), (CASE WHEN (leader_parent_team_1.name IS NULL) THEN concat(parent_team_lead_users_1.first_name, ' ', parent_team_lead_users_1.last_name) ELSE concat(leader_parent_team_lead_users_1.first_name, ' ', leader_parent_team_lead_users_1.last_name) END), users_4.title, (CASE WHEN users_4.is_active THEN 'Active'::text ELSE 'Inactive'::text END), (CASE WHEN (users_4.user_type = 0) THEN 'Default'::text WHEN (users_4.user_type = 1) THEN 'Seller'::text WHEN (users_4.user_type = 2) THEN 'Sales Manager'::text WHEN (users_4.user_type = 3) THEN 'Account Manager'::text WHEN (users_4.user_type = 4) THEN 'Manager Account Manager'::text WHEN (users_4.user_type = 5) THEN 'Admin'::text WHEN (users_4.user_type = 6) THEN 'Exec'::text ELSE 'Fake User'::text END), users_4.employee_id, users_4.office, users_4.default_currency, assignment_name_1.assignment_name, (date(users_4.last_sign_in_at)), ((('now'::cstring)::date - date(users_4.last_sign_in_at)))
140. 0.000 0.000 ↓ 0.0

Hash Join (cost=195.42..365.29 rows=136 width=325) (never executed)

141. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.76..354.01 rows=136 width=161) (never executed)

142. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.48..287.04 rows=136 width=152) (never executed)

143. 0.000 0.000 ↓ 0.0

Hash Join (cost=189.2..220.07 rows=136 width=143) (never executed)

144. 0.000 0.000 ↓ 0.0

Seq Scan on teams parent_team_1 (cost=0..24.58 rows=1,058 width=20) (never executed)

145. 0.000 0.000 ↓ 0.0

Hash (cost=187.5..187.5 rows=136 width=131) (never executed)

146. 0.000 0.000 ↓ 0.0

Hash Join (cost=155.55..187.5 rows=136 width=131) (never executed)

147. 0.000 0.000 ↓ 0.0

Hash Join (cost=117.74..148.61 rows=136 width=119) (never executed)

148. 0.000 0.000 ↓ 0.0

Seq Scan on teams leader_parent_team_1 (cost=0..24.58 rows=1,058 width=20) (never executed)

149. 0.000 0.000 ↓ 0.0

Hash (cost=116.04..116.04 rows=136 width=107) (never executed)

150. 0.000 0.000 ↓ 0.0

Merge Join (cost=98.75..116.04 rows=136 width=107) (never executed)

151. 0.000 0.000 ↓ 0.0

Index Scan using index_teams_on_leader_id on teams leader_team_1 (cost=0.28..37.15 rows=1,058 width=20) (never executed)

152. 0.000 0.000 ↓ 0.0

Sort (cost=98.48..98.82 rows=136 width=91) (never executed)

  • Sort Key: users_4.id
153. 0.000 0.000 ↓ 0.0

Index Scan using index_users_on_company_id on users users_4 (cost=0.28..93.66 rows=136 width=91) (never executed)

  • Index Cond: (company_id = 115)
  • Filter: (((email)::text <> 'success@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostrcrm.com'::text) AND ((email)::text <> 'success2@boostr.com'::text) AND ((email)::text <> 'success3@boostr.com'::text) AND ((email)::text <> 'success4@boostr.com'::text) AND ((email)::text <> 'success5@boostr.com'::text) AND ((email)::text <> 'support@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostr.com'::text))
154. 0.000 0.000 ↓ 0.0

Hash (cost=24.58..24.58 rows=1,058 width=20) (never executed)

155. 0.000 0.000 ↓ 0.0

Seq Scan on teams child_team_1 (cost=0..24.58 rows=1,058 width=20) (never executed)

156. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users leader_parent_team_lead_users_1 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = leader_parent_team_1.leader_id)
157. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users parent_team_lead_users_1 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = parent_team_1.leader_id)
158. 0.000 0.000 ↓ 0.0

Hash (cost=5.65..5.65 rows=1 width=36) (never executed)

159. 0.000 0.000 ↓ 0.0

Subquery Scan on assignment_name_1 (cost=5.63..5.65 rows=1 width=36) (never executed)

160. 0.000 0.000 ↓ 0.0

Unique (cost=5.63..5.64 rows=1 width=36) (never executed)

161. 0.000 0.000 ↓ 0.0

Sort (cost=5.63..5.63 rows=1 width=36) (never executed)

  • Sort Key: users_5.id, (btrim(string_agg(assignment_rules_1.name, ', '::text), ', '::text))
162. 0.000 0.000 ↓ 0.0

Aggregate (cost=5.58..5.62 rows=1 width=36) (never executed)

163. 0.000 0.000 ↓ 0.0

Unique (cost=5.58..5.59 rows=1 width=13) (never executed)

164. 0.000 0.000 ↓ 0.0

Sort (cost=5.58..5.58 rows=1 width=13) (never executed)

  • Sort Key: users_5.id, assignment_rules_1.name
165. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..5.57 rows=1 width=13) (never executed)

166. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4.33 rows=1 width=13) (never executed)

167. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_on_company_id on assignment_rules assignment_rules_1 (cost=0.14..2.16 rows=1 width=13) (never executed)

  • Index Cond: (company_id = 115)
168. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_users_on_assignment_rule_id on assignment_rules_users assignment_rules_users_1 (cost=0.14..2.16 rows=1 width=8) (never executed)

  • Index Cond: (assignment_rule_id = assignment_rules_1.id)
169. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users users_5 (cost=0.28..1.23 rows=1 width=4) (never executed)

  • Index Cond: (id = assignment_rules_users_1.user_id)
  • Filter: (company_id = 115)
170. 0.000 0.000 ↓ 0.0

Materialize (cost=34,703.67..34,708.09 rows=136 width=160) (never executed)

171. 0.000 0.000 ↓ 0.0

Subquery Scan on lgxGroup3 (cost=34,703.67..34,707.41 rows=136 width=160) (never executed)

172. 0.000 0.000 ↓ 0.0

Aggregate (cost=34,703.67..34,706.05 rows=136 width=160) (never executed)

173. 0.000 0.000 ↓ 0.0

Hash Join (cost=33,767.69..34,552.75 rows=5,488 width=88) (never executed)

174. 0.000 0.000 ↓ 0.0

Unique (cost=33,388.75..34,061.03 rows=5,488 width=522) (never executed)

175. 0.000 0.000 ↓ 0.0

Sort (cost=33,388.75..33,402.47 rows=5,488 width=522) (never executed)

  • Sort Key: ios_2.io_number, ios_2.id, ios_2.external_io_number, ios_2.name, deals_2.closed_at, advertiser_2.id, advertiser_2.name, agency_2.id, agency_2.name, ios_2.budget, ios_2.budget_loc, ios_2.curr_cd, ios_2.start_date, ios_2.end_date, users_6.id, (concat(users_6.first_name, ' ', users_6.last_name)), io_members_2.share, (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((ios_2.budget)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_2.budget * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((ios_2.budget_loc)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_2.budget_loc * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), io_members_2.from_date, io_members_2.to_date, ios_2.updated_at, display_line_items_2.id, display_line_items_2.line_number, display_line_items_2.ad_server, display_line_items_2.start_date, display_line_items_2.end_date, dis_prod_2.id, dis_prod_2.full_name, dis_prod_fam_2.name, (CASE WHEN (dis_parent_product_2.name IS NULL) THEN dis_prod_2.full_name ELSE dis_parent_product_2.name END), dis_sub_prod_1_2.name, dis_sub_prod_2_2.name, dis_prod_2.revenue_type, product_pricing_type_2.product_pricing_type, display_line_items_2.ad_unit, display_line_items_2.ad_server_product, display_line_items_2.quantity, display_line_items_2.price, display_line_items_2.pricing_type, (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((display_line_items_2.budget)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_2.budget * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((display_line_items_2.budget_delivered)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_2.budget_delivered * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((display_line_items_2.budget_remaining)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_2.budget_remaining * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((display_line_items_2.budget_loc)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_2.budget_loc * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((display_line_items_2.budget_delivered_loc)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_2.budget_delivered_loc * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_2.to_date <> ios_2.end_date) OR (io_members_2.from_date <> ios_2.start_date)) THEN (((((display_line_items_2.budget_remaining_loc)::double precision * ((io_members_2.to_date - io_members_2.from_date))::double precision) / NULLIF((((ios_2.end_date - ios_2.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_2.budget_remaining_loc * (io_members_2.share)::numeric) / '100'::numeric))::double precision END), display_line_items_2.quantity_delivered, display_line_items_2.quantity_remaining
176. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,723.34..33,047.89 rows=5,488 width=522) (never executed)

177. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,449.49..30,818.94 rows=5,488 width=440) (never executed)

178. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,786.89..30,108.51 rows=5,488 width=424) (never executed)

179. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,786.6..27,593.46 rows=3,790 width=408) (never executed)

180. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,848.42..26,317.19 rows=3,790 width=376) (never executed)

181. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,833.24..26,260.58 rows=3,790 width=368) (never executed)

182. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,832.65..20,058.91 rows=3,790 width=356) (never executed)

183. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,112.76..19,293.84 rows=3,790 width=344) (never executed)

184. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.88..18,537.79 rows=3,790 width=285) (never executed)

185. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.45..13,270.3 rows=3,790 width=277) (never executed)

186. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.03..8,873.37 rows=3,790 width=262) (never executed)

187. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,391.61..4,476.44 rows=3,790 width=247) (never executed)

188. 0.000 0.000 ↓ 0.0

Index Scan using index_display_line_items_on_io_id on display_line_items display_line_items_2 (cost=0.29..3,429.17 rows=57,592 width=165) (never executed)

189. 0.000 0.000 ↓ 0.0

Sort (cost=2,391.3..2,406.92 rows=6,250 width=90) (never executed)

  • Sort Key: ios_2.id
190. 0.000 0.000 ↓ 0.0

Index Scan using index_ios_on_company_id on ios ios_2 (cost=0.42..1,997.25 rows=6,250 width=90) (never executed)

  • Index Cond: (company_id = 115)
191. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients advertiser_2 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_2.advertiser_id)
192. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients agency_2 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_2.agency_id)
193. 0.000 0.000 ↓ 0.0

Index Scan using deals_pkey on deals deals_2 (cost=0.42..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = ios_2.io_number)
194. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=67) (never executed)

195. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_prod_2 (cost=0..531.06 rows=15,106 width=67) (never executed)

196. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=20) (never executed)

197. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_parent_product_2 (cost=0..531.06 rows=15,106 width=20) (never executed)

198. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on products dis_sub_prod_1_2 (cost=0.59..1.63 rows=1 width=20) (never executed)

  • Filter: (level = 1)
199. 0.000 0.000 ↓ 0.0

BitmapOr (cost=0.59..0.59 rows=2 width=0) (never executed)

200. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_2.parent_id)
201. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_2.id)
202. 0.000 0.000 ↓ 0.0

Hash (cost=10.08..10.08 rows=408 width=16) (never executed)

203. 0.000 0.000 ↓ 0.0

Seq Scan on product_families dis_prod_fam_2 (cost=0..10.08 rows=408 width=16) (never executed)

204. 0.000 0.000 ↓ 0.0

Hash (cost=929.54..929.54 rows=691 width=36) (never executed)

205. 0.000 0.000 ↓ 0.0

Subquery Scan on product_pricing_type_2 (cost=915.72..929.54 rows=691 width=36) (never executed)

206. 0.000 0.000 ↓ 0.0

Aggregate (cost=915.72..922.63 rows=691 width=36) (never executed)

207. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.25..912.26 rows=692 width=16) (never executed)

208. 0.000 0.000 ↓ 0.0

Hash Join (cost=90.44..591.25 rows=692 width=25) (never executed)

209. 0.000 0.000 ↓ 0.0

Index Scan using index_values_on_company_id_subject_type on values values_2 (cost=0.43..498.42 rows=692 width=12) (never executed)

  • Index Cond: ((company_id = 115) AND ((subject_type)::text = 'Product'::text))
210. 0.000 0.000 ↓ 0.0

Hash (cost=88.53..88.53 rows=119 width=17) (never executed)

211. 0.000 0.000 ↓ 0.0

Seq Scan on fields f_2 (cost=0..88.53 rows=119 width=17) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((name)::text = 'Pricing Type'::text))
212. 0.000 0.000 ↓ 0.0

Hash (cost=205.39..205.39 rows=7,361 width=20) (never executed)

213. 0.000 0.000 ↓ 0.0

Seq Scan on options product_pricing_type_options_2 (cost=0..205.39 rows=7,361 width=20) (never executed)

  • Filter: (deleted_at IS NULL)
214. 0.000 0.000 ↓ 0.0

Index Scan using index_io_members_on_io_id_user_id on io_members io_members_2 (cost=0.29..0.64 rows=2 width=20) (never executed)

  • Index Cond: (ios_2.id = io_id)
215. 0.000 0.000 ↓ 0.0

Hash (cost=568.83..568.83 rows=7,502 width=20) (never executed)

216. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_sub_prod_2_2 (cost=0..568.83 rows=7,502 width=20) (never executed)

  • Filter: (level = 2)
217. 0.000 0.000 ↓ 0.0

Hash (cost=220.6..220.6 rows=4,260 width=17) (never executed)

218. 0.000 0.000 ↓ 0.0

Seq Scan on users users_6 (cost=0..220.6 rows=4,260 width=17) (never executed)

219. 0.000 0.000 ↓ 0.0

Hash (cost=377.25..377.25 rows=136 width=68) (never executed)

220. 0.000 0.000 ↓ 0.0

Subquery Scan on q1_2 (cost=370.11..377.25 rows=136 width=68) (never executed)

221. 0.000 0.000 ↓ 0.0

Unique (cost=370.11..375.89 rows=136 width=325) (never executed)

222. 0.000 0.000 ↓ 0.0

Sort (cost=370.11..370.45 rows=136 width=325) (never executed)

  • Sort Key: users_7.id, users_7.email, (concat(users_7.first_name, ' ', users_7.last_name)), (CASE WHEN (leader_team_2.name IS NULL) THEN 'No'::text ELSE 'Yes'::text END), (CASE WHEN (leader_team_2.name IS NULL) THEN child_team_2.name ELSE leader_team_2.name END), (CASE WHEN (leader_parent_team_2.name IS NULL) THEN parent_team_2.name ELSE leader_parent_team_2.name END), (CASE WHEN (leader_parent_team_2.name IS NULL) THEN concat(parent_team_lead_users_2.first_name, ' ', parent_team_lead_users_2.last_name) ELSE concat(leader_parent_team_lead_users_2.first_name, ' ', leader_parent_team_lead_users_2.last_name) END), users_7.title, (CASE WHEN users_7.is_active THEN 'Active'::text ELSE 'Inactive'::text END), (CASE WHEN (users_7.user_type = 0) THEN 'Default'::text WHEN (users_7.user_type = 1) THEN 'Seller'::text WHEN (users_7.user_type = 2) THEN 'Sales Manager'::text WHEN (users_7.user_type = 3) THEN 'Account Manager'::text WHEN (users_7.user_type = 4) THEN 'Manager Account Manager'::text WHEN (users_7.user_type = 5) THEN 'Admin'::text WHEN (users_7.user_type = 6) THEN 'Exec'::text ELSE 'Fake User'::text END), users_7.employee_id, users_7.office, users_7.default_currency, assignment_name_2.assignment_name, (date(users_7.last_sign_in_at)), ((('now'::cstring)::date - date(users_7.last_sign_in_at)))
223. 0.000 0.000 ↓ 0.0

Hash Join (cost=195.42..365.29 rows=136 width=325) (never executed)

224. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.76..354.01 rows=136 width=161) (never executed)

225. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.48..287.04 rows=136 width=152) (never executed)

226. 0.000 0.000 ↓ 0.0

Hash Join (cost=189.2..220.07 rows=136 width=143) (never executed)

227. 0.000 0.000 ↓ 0.0

Seq Scan on teams parent_team_2 (cost=0..24.58 rows=1,058 width=20) (never executed)

228. 0.000 0.000 ↓ 0.0

Hash (cost=187.5..187.5 rows=136 width=131) (never executed)

229. 0.000 0.000 ↓ 0.0

Hash Join (cost=155.55..187.5 rows=136 width=131) (never executed)

230. 0.000 0.000 ↓ 0.0

Hash Join (cost=117.74..148.61 rows=136 width=119) (never executed)

231. 0.000 0.000 ↓ 0.0

Seq Scan on teams leader_parent_team_2 (cost=0..24.58 rows=1,058 width=20) (never executed)

232. 0.000 0.000 ↓ 0.0

Hash (cost=116.04..116.04 rows=136 width=107) (never executed)

233. 0.000 0.000 ↓ 0.0

Merge Join (cost=98.75..116.04 rows=136 width=107) (never executed)

234. 0.000 0.000 ↓ 0.0

Index Scan using index_teams_on_leader_id on teams leader_team_2 (cost=0.28..37.15 rows=1,058 width=20) (never executed)

235. 0.000 0.000 ↓ 0.0

Sort (cost=98.48..98.82 rows=136 width=91) (never executed)

  • Sort Key: users_7.id
236. 0.000 0.000 ↓ 0.0

Index Scan using index_users_on_company_id on users users_7 (cost=0.28..93.66 rows=136 width=91) (never executed)

  • Index Cond: (company_id = 115)
  • Filter: (((email)::text <> 'success@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostrcrm.com'::text) AND ((email)::text <> 'success2@boostr.com'::text) AND ((email)::text <> 'success3@boostr.com'::text) AND ((email)::text <> 'success4@boostr.com'::text) AND ((email)::text <> 'success5@boostr.com'::text) AND ((email)::text <> 'support@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostr.com'::text))
237. 0.000 0.000 ↓ 0.0

Hash (cost=24.58..24.58 rows=1,058 width=20) (never executed)

238. 0.000 0.000 ↓ 0.0

Seq Scan on teams child_team_2 (cost=0..24.58 rows=1,058 width=20) (never executed)

239. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users leader_parent_team_lead_users_2 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = leader_parent_team_2.leader_id)
240. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users parent_team_lead_users_2 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = parent_team_2.leader_id)
241. 0.000 0.000 ↓ 0.0

Hash (cost=5.65..5.65 rows=1 width=36) (never executed)

242. 0.000 0.000 ↓ 0.0

Subquery Scan on assignment_name_2 (cost=5.63..5.65 rows=1 width=36) (never executed)

243. 0.000 0.000 ↓ 0.0

Unique (cost=5.63..5.64 rows=1 width=36) (never executed)

244. 0.000 0.000 ↓ 0.0

Sort (cost=5.63..5.63 rows=1 width=36) (never executed)

  • Sort Key: users_8.id, (btrim(string_agg(assignment_rules_2.name, ', '::text), ', '::text))
245. 0.000 0.000 ↓ 0.0

Aggregate (cost=5.58..5.62 rows=1 width=36) (never executed)

246. 0.000 0.000 ↓ 0.0

Unique (cost=5.58..5.59 rows=1 width=13) (never executed)

247. 0.000 0.000 ↓ 0.0

Sort (cost=5.58..5.58 rows=1 width=13) (never executed)

  • Sort Key: users_8.id, assignment_rules_2.name
248. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..5.57 rows=1 width=13) (never executed)

249. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4.33 rows=1 width=13) (never executed)

250. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_on_company_id on assignment_rules assignment_rules_2 (cost=0.14..2.16 rows=1 width=13) (never executed)

  • Index Cond: (company_id = 115)
251. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_users_on_assignment_rule_id on assignment_rules_users assignment_rules_users_2 (cost=0.14..2.16 rows=1 width=8) (never executed)

  • Index Cond: (assignment_rule_id = assignment_rules_2.id)
252. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users users_8 (cost=0.28..1.23 rows=1 width=4) (never executed)

  • Index Cond: (id = assignment_rules_users_2.user_id)
  • Filter: (company_id = 115)
253. 0.000 0.000 ↓ 0.0

Aggregate (cost=34,689.95..34,692.33 rows=136 width=128) (never executed)

254. 0.000 0.000 ↓ 0.0

Hash Join (cost=33,767.69..34,552.75 rows=5,488 width=56) (never executed)

255. 0.000 0.000 ↓ 0.0

Unique (cost=33,388.75..34,061.03 rows=5,488 width=522) (never executed)

256. 0.000 0.000 ↓ 0.0

Sort (cost=33,388.75..33,402.47 rows=5,488 width=522) (never executed)

  • Sort Key: ios_3.io_number, ios_3.id, ios_3.external_io_number, ios_3.name, deals_3.closed_at, advertiser_3.id, advertiser_3.name, agency_3.id, agency_3.name, ios_3.budget, ios_3.budget_loc, ios_3.curr_cd, ios_3.start_date, ios_3.end_date, users_9.id, (concat(users_9.first_name, ' ', users_9.last_name)), io_members_3.share, (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((ios_3.budget)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_3.budget * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((ios_3.budget_loc)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_3.budget_loc * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), io_members_3.from_date, io_members_3.to_date, ios_3.updated_at, display_line_items_3.id, display_line_items_3.line_number, display_line_items_3.ad_server, display_line_items_3.start_date, display_line_items_3.end_date, dis_prod_3.id, dis_prod_3.full_name, dis_prod_fam_3.name, (CASE WHEN (dis_parent_product_3.name IS NULL) THEN dis_prod_3.full_name ELSE dis_parent_product_3.name END), dis_sub_prod_1_3.name, dis_sub_prod_2_3.name, dis_prod_3.revenue_type, product_pricing_type_3.product_pricing_type, display_line_items_3.ad_unit, display_line_items_3.ad_server_product, display_line_items_3.quantity, display_line_items_3.price, display_line_items_3.pricing_type, (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((display_line_items_3.budget)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_3.budget * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((display_line_items_3.budget_delivered)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_3.budget_delivered * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((display_line_items_3.budget_remaining)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_3.budget_remaining * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((display_line_items_3.budget_loc)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_3.budget_loc * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((display_line_items_3.budget_delivered_loc)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_3.budget_delivered_loc * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_3.to_date <> ios_3.end_date) OR (io_members_3.from_date <> ios_3.start_date)) THEN (((((display_line_items_3.budget_remaining_loc)::double precision * ((io_members_3.to_date - io_members_3.from_date))::double precision) / NULLIF((((ios_3.end_date - ios_3.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_3.budget_remaining_loc * (io_members_3.share)::numeric) / '100'::numeric))::double precision END), display_line_items_3.quantity_delivered, display_line_items_3.quantity_remaining
257. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,723.34..33,047.89 rows=5,488 width=522) (never executed)

258. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,449.49..30,818.94 rows=5,488 width=440) (never executed)

259. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,786.89..30,108.51 rows=5,488 width=424) (never executed)

260. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,786.6..27,593.46 rows=3,790 width=408) (never executed)

261. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,848.42..26,317.19 rows=3,790 width=376) (never executed)

262. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,833.24..26,260.58 rows=3,790 width=368) (never executed)

263. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,832.65..20,058.91 rows=3,790 width=356) (never executed)

264. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,112.76..19,293.84 rows=3,790 width=344) (never executed)

265. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.88..18,537.79 rows=3,790 width=285) (never executed)

266. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.45..13,270.3 rows=3,790 width=277) (never executed)

267. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.03..8,873.37 rows=3,790 width=262) (never executed)

268. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,391.61..4,476.44 rows=3,790 width=247) (never executed)

269. 0.000 0.000 ↓ 0.0

Index Scan using index_display_line_items_on_io_id on display_line_items display_line_items_3 (cost=0.29..3,429.17 rows=57,592 width=165) (never executed)

270. 0.000 0.000 ↓ 0.0

Sort (cost=2,391.3..2,406.92 rows=6,250 width=90) (never executed)

  • Sort Key: ios_3.id
271. 0.000 0.000 ↓ 0.0

Index Scan using index_ios_on_company_id on ios ios_3 (cost=0.42..1,997.25 rows=6,250 width=90) (never executed)

  • Index Cond: (company_id = 115)
272. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients advertiser_3 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_3.advertiser_id)
273. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients agency_3 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_3.agency_id)
274. 0.000 0.000 ↓ 0.0

Index Scan using deals_pkey on deals deals_3 (cost=0.42..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = ios_3.io_number)
275. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=67) (never executed)

276. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_prod_3 (cost=0..531.06 rows=15,106 width=67) (never executed)

277. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=20) (never executed)

278. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_parent_product_3 (cost=0..531.06 rows=15,106 width=20) (never executed)

279. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on products dis_sub_prod_1_3 (cost=0.59..1.63 rows=1 width=20) (never executed)

  • Filter: (level = 1)
280. 0.000 0.000 ↓ 0.0

BitmapOr (cost=0.59..0.59 rows=2 width=0) (never executed)

281. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_3.parent_id)
282. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_3.id)
283. 0.000 0.000 ↓ 0.0

Hash (cost=10.08..10.08 rows=408 width=16) (never executed)

284. 0.000 0.000 ↓ 0.0

Seq Scan on product_families dis_prod_fam_3 (cost=0..10.08 rows=408 width=16) (never executed)

285. 0.000 0.000 ↓ 0.0

Hash (cost=929.54..929.54 rows=691 width=36) (never executed)

286. 0.000 0.000 ↓ 0.0

Subquery Scan on product_pricing_type_3 (cost=915.72..929.54 rows=691 width=36) (never executed)

287. 0.000 0.000 ↓ 0.0

Aggregate (cost=915.72..922.63 rows=691 width=36) (never executed)

288. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.25..912.26 rows=692 width=16) (never executed)

289. 0.000 0.000 ↓ 0.0

Hash Join (cost=90.44..591.25 rows=692 width=25) (never executed)

290. 0.000 0.000 ↓ 0.0

Index Scan using index_values_on_company_id_subject_type on values values_3 (cost=0.43..498.42 rows=692 width=12) (never executed)

  • Index Cond: ((company_id = 115) AND ((subject_type)::text = 'Product'::text))
291. 0.000 0.000 ↓ 0.0

Hash (cost=88.53..88.53 rows=119 width=17) (never executed)

292. 0.000 0.000 ↓ 0.0

Seq Scan on fields f_3 (cost=0..88.53 rows=119 width=17) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((name)::text = 'Pricing Type'::text))
293. 0.000 0.000 ↓ 0.0

Hash (cost=205.39..205.39 rows=7,361 width=20) (never executed)

294. 0.000 0.000 ↓ 0.0

Seq Scan on options product_pricing_type_options_3 (cost=0..205.39 rows=7,361 width=20) (never executed)

  • Filter: (deleted_at IS NULL)
295. 0.000 0.000 ↓ 0.0

Index Scan using index_io_members_on_io_id_user_id on io_members io_members_3 (cost=0.29..0.64 rows=2 width=20) (never executed)

  • Index Cond: (ios_3.id = io_id)
296. 0.000 0.000 ↓ 0.0

Hash (cost=568.83..568.83 rows=7,502 width=20) (never executed)

297. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_sub_prod_2_3 (cost=0..568.83 rows=7,502 width=20) (never executed)

  • Filter: (level = 2)
298. 0.000 0.000 ↓ 0.0

Hash (cost=220.6..220.6 rows=4,260 width=17) (never executed)

299. 0.000 0.000 ↓ 0.0

Seq Scan on users users_9 (cost=0..220.6 rows=4,260 width=17) (never executed)

300. 0.000 0.000 ↓ 0.0

Hash (cost=377.25..377.25 rows=136 width=36) (never executed)

301. 0.000 0.000 ↓ 0.0

Subquery Scan on q1_3 (cost=370.11..377.25 rows=136 width=36) (never executed)

302. 0.000 0.000 ↓ 0.0

Unique (cost=370.11..375.89 rows=136 width=325) (never executed)

303. 0.000 0.000 ↓ 0.0

Sort (cost=370.11..370.45 rows=136 width=325) (never executed)

  • Sort Key: users_10.id, users_10.email, (concat(users_10.first_name, ' ', users_10.last_name)), (CASE WHEN (leader_team_3.name IS NULL) THEN 'No'::text ELSE 'Yes'::text END), (CASE WHEN (leader_team_3.name IS NULL) THEN child_team_3.name ELSE leader_team_3.name END), (CASE WHEN (leader_parent_team_3.name IS NULL) THEN parent_team_3.name ELSE leader_parent_team_3.name END), (CASE WHEN (leader_parent_team_3.name IS NULL) THEN concat(parent_team_lead_users_3.first_name, ' ', parent_team_lead_users_3.last_name) ELSE concat(leader_parent_team_lead_users_3.first_name, ' ', leader_parent_team_lead_users_3.last_name) END), users_10.title, (CASE WHEN users_10.is_active THEN 'Active'::text ELSE 'Inactive'::text END), (CASE WHEN (users_10.user_type = 0) THEN 'Default'::text WHEN (users_10.user_type = 1) THEN 'Seller'::text WHEN (users_10.user_type = 2) THEN 'Sales Manager'::text WHEN (users_10.user_type = 3) THEN 'Account Manager'::text WHEN (users_10.user_type = 4) THEN 'Manager Account Manager'::text WHEN (users_10.user_type = 5) THEN 'Admin'::text WHEN (users_10.user_type = 6) THEN 'Exec'::text ELSE 'Fake User'::text END), users_10.employee_id, users_10.office, users_10.default_currency, assignment_name_3.assignment_name, (date(users_10.last_sign_in_at)), ((('now'::cstring)::date - date(users_10.last_sign_in_at)))
304. 0.000 0.000 ↓ 0.0

Hash Join (cost=195.42..365.29 rows=136 width=325) (never executed)

305. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.76..354.01 rows=136 width=161) (never executed)

306. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.48..287.04 rows=136 width=152) (never executed)

307. 0.000 0.000 ↓ 0.0

Hash Join (cost=189.2..220.07 rows=136 width=143) (never executed)

308. 0.000 0.000 ↓ 0.0

Seq Scan on teams parent_team_3 (cost=0..24.58 rows=1,058 width=20) (never executed)

309. 0.000 0.000 ↓ 0.0

Hash (cost=187.5..187.5 rows=136 width=131) (never executed)

310. 0.000 0.000 ↓ 0.0

Hash Join (cost=155.55..187.5 rows=136 width=131) (never executed)

311. 0.000 0.000 ↓ 0.0

Hash Join (cost=117.74..148.61 rows=136 width=119) (never executed)

312. 0.000 0.000 ↓ 0.0

Seq Scan on teams leader_parent_team_3 (cost=0..24.58 rows=1,058 width=20) (never executed)

313. 0.000 0.000 ↓ 0.0

Hash (cost=116.04..116.04 rows=136 width=107) (never executed)

314. 0.000 0.000 ↓ 0.0

Merge Join (cost=98.75..116.04 rows=136 width=107) (never executed)

315. 0.000 0.000 ↓ 0.0

Index Scan using index_teams_on_leader_id on teams leader_team_3 (cost=0.28..37.15 rows=1,058 width=20) (never executed)

316. 0.000 0.000 ↓ 0.0

Sort (cost=98.48..98.82 rows=136 width=91) (never executed)

  • Sort Key: users_10.id
317. 0.000 0.000 ↓ 0.0

Index Scan using index_users_on_company_id on users users_10 (cost=0.28..93.66 rows=136 width=91) (never executed)

  • Index Cond: (company_id = 115)
  • Filter: (((email)::text <> 'success@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostrcrm.com'::text) AND ((email)::text <> 'success2@boostr.com'::text) AND ((email)::text <> 'success3@boostr.com'::text) AND ((email)::text <> 'success4@boostr.com'::text) AND ((email)::text <> 'success5@boostr.com'::text) AND ((email)::text <> 'support@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostr.com'::text))
318. 0.000 0.000 ↓ 0.0

Hash (cost=24.58..24.58 rows=1,058 width=20) (never executed)

319. 0.000 0.000 ↓ 0.0

Seq Scan on teams child_team_3 (cost=0..24.58 rows=1,058 width=20) (never executed)

320. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users leader_parent_team_lead_users_3 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = leader_parent_team_3.leader_id)
321. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users parent_team_lead_users_3 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = parent_team_3.leader_id)
322. 0.000 0.000 ↓ 0.0

Hash (cost=5.65..5.65 rows=1 width=36) (never executed)

323. 0.000 0.000 ↓ 0.0

Subquery Scan on assignment_name_3 (cost=5.63..5.65 rows=1 width=36) (never executed)

324. 0.000 0.000 ↓ 0.0

Unique (cost=5.63..5.64 rows=1 width=36) (never executed)

325. 0.000 0.000 ↓ 0.0

Sort (cost=5.63..5.63 rows=1 width=36) (never executed)

  • Sort Key: users_11.id, (btrim(string_agg(assignment_rules_3.name, ', '::text), ', '::text))
326. 0.000 0.000 ↓ 0.0

Aggregate (cost=5.58..5.62 rows=1 width=36) (never executed)

327. 0.000 0.000 ↓ 0.0

Unique (cost=5.58..5.59 rows=1 width=13) (never executed)

328. 0.000 0.000 ↓ 0.0

Sort (cost=5.58..5.58 rows=1 width=13) (never executed)

  • Sort Key: users_11.id, assignment_rules_3.name
329. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..5.57 rows=1 width=13) (never executed)

330. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4.33 rows=1 width=13) (never executed)

331. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_on_company_id on assignment_rules assignment_rules_3 (cost=0.14..2.16 rows=1 width=13) (never executed)

  • Index Cond: (company_id = 115)
332. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_users_on_assignment_rule_id on assignment_rules_users assignment_rules_users_3 (cost=0.14..2.16 rows=1 width=8) (never executed)

  • Index Cond: (assignment_rule_id = assignment_rules_3.id)
333. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users users_11 (cost=0.28..1.23 rows=1 width=4) (never executed)

  • Index Cond: (id = assignment_rules_users_3.user_id)
  • Filter: (company_id = 115)
334. 0.000 0.000 ↓ 0.0

Aggregate (cost=34,731.11..34,827.15 rows=5,488 width=226) (never executed)

335. 0.000 0.000 ↓ 0.0

Hash Join (cost=33,767.69..34,552.75 rows=5,488 width=154) (never executed)

336. 0.000 0.000 ↓ 0.0

Unique (cost=33,388.75..34,061.03 rows=5,488 width=522) (never executed)

337. 0.000 0.000 ↓ 0.0

Sort (cost=33,388.75..33,402.47 rows=5,488 width=522) (never executed)

  • Sort Key: ios_4.io_number, ios_4.id, ios_4.external_io_number, ios_4.name, deals_4.closed_at, advertiser_4.id, advertiser_4.name, agency_4.id, agency_4.name, ios_4.budget, ios_4.budget_loc, ios_4.curr_cd, ios_4.start_date, ios_4.end_date, users_12.id, (concat(users_12.first_name, ' ', users_12.last_name)), io_members_4.share, (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((ios_4.budget)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_4.budget * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((ios_4.budget_loc)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_4.budget_loc * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), io_members_4.from_date, io_members_4.to_date, ios_4.updated_at, display_line_items_4.id, display_line_items_4.line_number, display_line_items_4.ad_server, display_line_items_4.start_date, display_line_items_4.end_date, dis_prod_4.id, dis_prod_4.full_name, dis_prod_fam_4.name, (CASE WHEN (dis_parent_product_4.name IS NULL) THEN dis_prod_4.full_name ELSE dis_parent_product_4.name END), dis_sub_prod_1_4.name, dis_sub_prod_2_4.name, dis_prod_4.revenue_type, product_pricing_type_4.product_pricing_type, display_line_items_4.ad_unit, display_line_items_4.ad_server_product, display_line_items_4.quantity, display_line_items_4.price, display_line_items_4.pricing_type, (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((display_line_items_4.budget)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_4.budget * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((display_line_items_4.budget_delivered)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_4.budget_delivered * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((display_line_items_4.budget_remaining)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_4.budget_remaining * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((display_line_items_4.budget_loc)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_4.budget_loc * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((display_line_items_4.budget_delivered_loc)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_4.budget_delivered_loc * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_4.to_date <> ios_4.end_date) OR (io_members_4.from_date <> ios_4.start_date)) THEN (((((display_line_items_4.budget_remaining_loc)::double precision * ((io_members_4.to_date - io_members_4.from_date))::double precision) / NULLIF((((ios_4.end_date - ios_4.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_4.budget_remaining_loc * (io_members_4.share)::numeric) / '100'::numeric))::double precision END), display_line_items_4.quantity_delivered, display_line_items_4.quantity_remaining
338. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,723.34..33,047.89 rows=5,488 width=522) (never executed)

339. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,449.49..30,818.94 rows=5,488 width=440) (never executed)

340. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,786.89..30,108.51 rows=5,488 width=424) (never executed)

341. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,786.6..27,593.46 rows=3,790 width=408) (never executed)

342. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,848.42..26,317.19 rows=3,790 width=376) (never executed)

343. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,833.24..26,260.58 rows=3,790 width=368) (never executed)

344. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,832.65..20,058.91 rows=3,790 width=356) (never executed)

345. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,112.76..19,293.84 rows=3,790 width=344) (never executed)

346. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.88..18,537.79 rows=3,790 width=285) (never executed)

347. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.45..13,270.3 rows=3,790 width=277) (never executed)

348. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.03..8,873.37 rows=3,790 width=262) (never executed)

349. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,391.61..4,476.44 rows=3,790 width=247) (never executed)

350. 0.000 0.000 ↓ 0.0

Index Scan using index_display_line_items_on_io_id on display_line_items display_line_items_4 (cost=0.29..3,429.17 rows=57,592 width=165) (never executed)

351. 0.000 0.000 ↓ 0.0

Sort (cost=2,391.3..2,406.92 rows=6,250 width=90) (never executed)

  • Sort Key: ios_4.id
352. 0.000 0.000 ↓ 0.0

Index Scan using index_ios_on_company_id on ios ios_4 (cost=0.42..1,997.25 rows=6,250 width=90) (never executed)

  • Index Cond: (company_id = 115)
353. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients advertiser_4 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_4.advertiser_id)
354. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients agency_4 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_4.agency_id)
355. 0.000 0.000 ↓ 0.0

Index Scan using deals_pkey on deals deals_4 (cost=0.42..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = ios_4.io_number)
356. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=67) (never executed)

357. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_prod_4 (cost=0..531.06 rows=15,106 width=67) (never executed)

358. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=20) (never executed)

359. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_parent_product_4 (cost=0..531.06 rows=15,106 width=20) (never executed)

360. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on products dis_sub_prod_1_4 (cost=0.59..1.63 rows=1 width=20) (never executed)

  • Filter: (level = 1)
361. 0.000 0.000 ↓ 0.0

BitmapOr (cost=0.59..0.59 rows=2 width=0) (never executed)

362. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_4.parent_id)
363. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_4.id)
364. 0.000 0.000 ↓ 0.0

Hash (cost=10.08..10.08 rows=408 width=16) (never executed)

365. 0.000 0.000 ↓ 0.0

Seq Scan on product_families dis_prod_fam_4 (cost=0..10.08 rows=408 width=16) (never executed)

366. 0.000 0.000 ↓ 0.0

Hash (cost=929.54..929.54 rows=691 width=36) (never executed)

367. 0.000 0.000 ↓ 0.0

Subquery Scan on product_pricing_type_4 (cost=915.72..929.54 rows=691 width=36) (never executed)

368. 0.000 0.000 ↓ 0.0

Aggregate (cost=915.72..922.63 rows=691 width=36) (never executed)

369. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.25..912.26 rows=692 width=16) (never executed)

370. 0.000 0.000 ↓ 0.0

Hash Join (cost=90.44..591.25 rows=692 width=25) (never executed)

371. 0.000 0.000 ↓ 0.0

Index Scan using index_values_on_company_id_subject_type on values values_4 (cost=0.43..498.42 rows=692 width=12) (never executed)

  • Index Cond: ((company_id = 115) AND ((subject_type)::text = 'Product'::text))
372. 0.000 0.000 ↓ 0.0

Hash (cost=88.53..88.53 rows=119 width=17) (never executed)

373. 0.000 0.000 ↓ 0.0

Seq Scan on fields f_4 (cost=0..88.53 rows=119 width=17) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((name)::text = 'Pricing Type'::text))
374. 0.000 0.000 ↓ 0.0

Hash (cost=205.39..205.39 rows=7,361 width=20) (never executed)

375. 0.000 0.000 ↓ 0.0

Seq Scan on options product_pricing_type_options_4 (cost=0..205.39 rows=7,361 width=20) (never executed)

  • Filter: (deleted_at IS NULL)
376. 0.000 0.000 ↓ 0.0

Index Scan using index_io_members_on_io_id_user_id on io_members io_members_4 (cost=0.29..0.64 rows=2 width=20) (never executed)

  • Index Cond: (ios_4.id = io_id)
377. 0.000 0.000 ↓ 0.0

Hash (cost=568.83..568.83 rows=7,502 width=20) (never executed)

378. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_sub_prod_2_4 (cost=0..568.83 rows=7,502 width=20) (never executed)

  • Filter: (level = 2)
379. 0.000 0.000 ↓ 0.0

Hash (cost=220.6..220.6 rows=4,260 width=17) (never executed)

380. 0.000 0.000 ↓ 0.0

Seq Scan on users users_12 (cost=0..220.6 rows=4,260 width=17) (never executed)

381. 0.000 0.000 ↓ 0.0

Hash (cost=377.25..377.25 rows=136 width=68) (never executed)

382. 0.000 0.000 ↓ 0.0

Subquery Scan on q1_4 (cost=370.11..377.25 rows=136 width=68) (never executed)

383. 0.000 0.000 ↓ 0.0

Unique (cost=370.11..375.89 rows=136 width=325) (never executed)

384. 0.000 0.000 ↓ 0.0

Sort (cost=370.11..370.45 rows=136 width=325) (never executed)

  • Sort Key: users_13.id, users_13.email, (concat(users_13.first_name, ' ', users_13.last_name)), (CASE WHEN (leader_team_4.name IS NULL) THEN 'No'::text ELSE 'Yes'::text END), (CASE WHEN (leader_team_4.name IS NULL) THEN child_team_4.name ELSE leader_team_4.name END), (CASE WHEN (leader_parent_team_4.name IS NULL) THEN parent_team_4.name ELSE leader_parent_team_4.name END), (CASE WHEN (leader_parent_team_4.name IS NULL) THEN concat(parent_team_lead_users_4.first_name, ' ', parent_team_lead_users_4.last_name) ELSE concat(leader_parent_team_lead_users_4.first_name, ' ', leader_parent_team_lead_users_4.last_name) END), users_13.title, (CASE WHEN users_13.is_active THEN 'Active'::text ELSE 'Inactive'::text END), (CASE WHEN (users_13.user_type = 0) THEN 'Default'::text WHEN (users_13.user_type = 1) THEN 'Seller'::text WHEN (users_13.user_type = 2) THEN 'Sales Manager'::text WHEN (users_13.user_type = 3) THEN 'Account Manager'::text WHEN (users_13.user_type = 4) THEN 'Manager Account Manager'::text WHEN (users_13.user_type = 5) THEN 'Admin'::text WHEN (users_13.user_type = 6) THEN 'Exec'::text ELSE 'Fake User'::text END), users_13.employee_id, users_13.office, users_13.default_currency, assignment_name_4.assignment_name, (date(users_13.last_sign_in_at)), ((('now'::cstring)::date - date(users_13.last_sign_in_at)))
385. 0.000 0.000 ↓ 0.0

Hash Join (cost=195.42..365.29 rows=136 width=325) (never executed)

386. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.76..354.01 rows=136 width=161) (never executed)

387. 0.000 0.000 ↓ 0.0

Nested Loop (cost=189.48..287.04 rows=136 width=152) (never executed)

388. 0.000 0.000 ↓ 0.0

Hash Join (cost=189.2..220.07 rows=136 width=143) (never executed)

389. 0.000 0.000 ↓ 0.0

Seq Scan on teams parent_team_4 (cost=0..24.58 rows=1,058 width=20) (never executed)

390. 0.000 0.000 ↓ 0.0

Hash (cost=187.5..187.5 rows=136 width=131) (never executed)

391. 0.000 0.000 ↓ 0.0

Hash Join (cost=155.55..187.5 rows=136 width=131) (never executed)

392. 0.000 0.000 ↓ 0.0

Hash Join (cost=117.74..148.61 rows=136 width=119) (never executed)

393. 0.000 0.000 ↓ 0.0

Seq Scan on teams leader_parent_team_4 (cost=0..24.58 rows=1,058 width=20) (never executed)

394. 0.000 0.000 ↓ 0.0

Hash (cost=116.04..116.04 rows=136 width=107) (never executed)

395. 0.000 0.000 ↓ 0.0

Merge Join (cost=98.75..116.04 rows=136 width=107) (never executed)

396. 0.000 0.000 ↓ 0.0

Index Scan using index_teams_on_leader_id on teams leader_team_4 (cost=0.28..37.15 rows=1,058 width=20) (never executed)

397. 0.000 0.000 ↓ 0.0

Sort (cost=98.48..98.82 rows=136 width=91) (never executed)

  • Sort Key: users_13.id
398. 0.000 0.000 ↓ 0.0

Index Scan using index_users_on_company_id on users users_13 (cost=0.28..93.66 rows=136 width=91) (never executed)

  • Index Cond: (company_id = 115)
  • Filter: (((email)::text <> 'success@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostrcrm.com'::text) AND ((email)::text <> 'success2@boostr.com'::text) AND ((email)::text <> 'success3@boostr.com'::text) AND ((email)::text <> 'success4@boostr.com'::text) AND ((email)::text <> 'success5@boostr.com'::text) AND ((email)::text <> 'support@boostrcrm.com'::text) AND ((email)::text <> 'success1@boostr.com'::text))
399. 0.000 0.000 ↓ 0.0

Hash (cost=24.58..24.58 rows=1,058 width=20) (never executed)

400. 0.000 0.000 ↓ 0.0

Seq Scan on teams child_team_4 (cost=0..24.58 rows=1,058 width=20) (never executed)

401. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users leader_parent_team_lead_users_4 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = leader_parent_team_4.leader_id)
402. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users parent_team_lead_users_4 (cost=0.28..0.48 rows=1 width=17) (never executed)

  • Index Cond: (id = parent_team_4.leader_id)
403. 0.000 0.000 ↓ 0.0

Hash (cost=5.65..5.65 rows=1 width=36) (never executed)

404. 0.000 0.000 ↓ 0.0

Subquery Scan on assignment_name_4 (cost=5.63..5.65 rows=1 width=36) (never executed)

405. 0.000 0.000 ↓ 0.0

Unique (cost=5.63..5.64 rows=1 width=36) (never executed)

406. 0.000 0.000 ↓ 0.0

Sort (cost=5.63..5.63 rows=1 width=36) (never executed)

  • Sort Key: users_14.id, (btrim(string_agg(assignment_rules_4.name, ', '::text), ', '::text))
407. 0.000 0.000 ↓ 0.0

Aggregate (cost=5.58..5.62 rows=1 width=36) (never executed)

408. 0.000 0.000 ↓ 0.0

Unique (cost=5.58..5.59 rows=1 width=13) (never executed)

409. 0.000 0.000 ↓ 0.0

Sort (cost=5.58..5.58 rows=1 width=13) (never executed)

  • Sort Key: users_14.id, assignment_rules_4.name
410. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..5.57 rows=1 width=13) (never executed)

411. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..4.33 rows=1 width=13) (never executed)

412. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_on_company_id on assignment_rules assignment_rules_4 (cost=0.14..2.16 rows=1 width=13) (never executed)

  • Index Cond: (company_id = 115)
413. 0.000 0.000 ↓ 0.0

Index Scan using index_assignment_rules_users_on_assignment_rule_id on assignment_rules_users assignment_rules_users_4 (cost=0.14..2.16 rows=1 width=8) (never executed)

  • Index Cond: (assignment_rule_id = assignment_rules_4.id)
414. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users users_14 (cost=0.28..1.23 rows=1 width=4) (never executed)

  • Index Cond: (id = assignment_rules_users_4.user_id)
  • Filter: (company_id = 115)
415. 0.000 0.000 ↓ 0.0

Aggregate (cost=34,253.12..34,253.13 rows=1 width=96) (never executed)

416. 0.000 0.000 ↓ 0.0

Unique (cost=33,402.47..34,074.75 rows=5,488 width=522) (never executed)

417. 0.000 0.000 ↓ 0.0

Sort (cost=33,402.47..33,416.19 rows=5,488 width=522) (never executed)

  • Sort Key: ios_5.io_number, ios_5.id, ios_5.external_io_number, ios_5.name, deals_5.closed_at, advertiser_5.id, advertiser_5.name, agency_5.id, agency_5.name, ios_5.budget, ios_5.budget_loc, ios_5.curr_cd, ios_5.start_date, ios_5.end_date, users_15.id, ((((users_15.first_name)::text || ' '::text) || (users_15.last_name)::text)), io_members_5.share, (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((ios_5.budget)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_5.budget * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((ios_5.budget_loc)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((ios_5.budget_loc * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), io_members_5.from_date, io_members_5.to_date, ios_5.updated_at, display_line_items_5.id, display_line_items_5.line_number, display_line_items_5.ad_server, display_line_items_5.start_date, display_line_items_5.end_date, dis_prod_5.id, dis_prod_5.full_name, dis_prod_fam_5.name, (CASE WHEN (dis_parent_product_5.name IS NULL) THEN dis_prod_5.full_name ELSE dis_parent_product_5.name END), dis_sub_prod_1_5.name, dis_sub_prod_2_5.name, dis_prod_5.revenue_type, product_pricing_type_5.product_pricing_type, display_line_items_5.ad_unit, display_line_items_5.ad_server_product, display_line_items_5.quantity, display_line_items_5.price, display_line_items_5.pricing_type, (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((display_line_items_5.budget)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_5.budget * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((display_line_items_5.budget_delivered)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_5.budget_delivered * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((display_line_items_5.budget_remaining)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_5.budget_remaining * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((display_line_items_5.budget_loc)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_5.budget_loc * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((display_line_items_5.budget_delivered_loc)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_5.budget_delivered_loc * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), (CASE WHEN ((io_members_5.to_date <> ios_5.end_date) OR (io_members_5.from_date <> ios_5.start_date)) THEN (((((display_line_items_5.budget_remaining_loc)::double precision * ((io_members_5.to_date - io_members_5.from_date))::double precision) / NULLIF((((ios_5.end_date - ios_5.start_date) - 1))::double precision, '0'::double precision)) * '100'::double precision) / '100'::double precision) ELSE (((display_line_items_5.budget_remaining_loc * (io_members_5.share)::numeric) / '100'::numeric))::double precision END), display_line_items_5.quantity_delivered, display_line_items_5.quantity_remaining
418. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,723.34..33,061.61 rows=5,488 width=522) (never executed)

419. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,449.49..30,818.94 rows=5,488 width=440) (never executed)

420. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4,786.89..30,108.51 rows=5,488 width=424) (never executed)

421. 0.000 0.000 ↓ 0.0

Hash Join (cost=4,786.6..27,593.46 rows=3,790 width=408) (never executed)

422. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,848.42..26,317.19 rows=3,790 width=376) (never executed)

423. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3,833.24..26,260.58 rows=3,790 width=368) (never executed)

424. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,832.65..20,058.91 rows=3,790 width=356) (never executed)

425. 0.000 0.000 ↓ 0.0

Hash Join (cost=3,112.76..19,293.84 rows=3,790 width=344) (never executed)

426. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.88..18,537.79 rows=3,790 width=285) (never executed)

427. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.45..13,270.3 rows=3,790 width=277) (never executed)

428. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2,392.03..8,873.37 rows=3,790 width=262) (never executed)

429. 0.000 0.000 ↓ 0.0

Merge Join (cost=2,391.61..4,476.44 rows=3,790 width=247) (never executed)

430. 0.000 0.000 ↓ 0.0

Index Scan using index_display_line_items_on_io_id on display_line_items display_line_items_5 (cost=0.29..3,429.17 rows=57,592 width=165) (never executed)

431. 0.000 0.000 ↓ 0.0

Sort (cost=2,391.3..2,406.92 rows=6,250 width=90) (never executed)

  • Sort Key: ios_5.id
432. 0.000 0.000 ↓ 0.0

Index Scan using index_ios_on_company_id on ios ios_5 (cost=0.42..1,997.25 rows=6,250 width=90) (never executed)

  • Index Cond: (company_id = 115)
433. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients advertiser_5 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_5.advertiser_id)
434. 0.000 0.000 ↓ 0.0

Index Scan using clients_pkey on clients agency_5 (cost=0.42..1.15 rows=1 width=19) (never executed)

  • Index Cond: (id = ios_5.agency_id)
435. 0.000 0.000 ↓ 0.0

Index Scan using deals_pkey on deals deals_5 (cost=0.42..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = ios_5.io_number)
436. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=67) (never executed)

437. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_prod_5 (cost=0..531.06 rows=15,106 width=67) (never executed)

438. 0.000 0.000 ↓ 0.0

Hash (cost=531.06..531.06 rows=15,106 width=20) (never executed)

439. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_parent_product_5 (cost=0..531.06 rows=15,106 width=20) (never executed)

440. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on products dis_sub_prod_1_5 (cost=0.59..1.63 rows=1 width=20) (never executed)

  • Filter: (level = 1)
441. 0.000 0.000 ↓ 0.0

BitmapOr (cost=0.59..0.59 rows=2 width=0) (never executed)

442. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_5.parent_id)
443. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on products_pkey (cost=0..0.3 rows=1 width=0) (never executed)

  • Index Cond: (id = dis_prod_5.id)
444. 0.000 0.000 ↓ 0.0

Hash (cost=10.08..10.08 rows=408 width=16) (never executed)

445. 0.000 0.000 ↓ 0.0

Seq Scan on product_families dis_prod_fam_5 (cost=0..10.08 rows=408 width=16) (never executed)

446. 0.000 0.000 ↓ 0.0

Hash (cost=929.54..929.54 rows=691 width=36) (never executed)

447. 0.000 0.000 ↓ 0.0

Subquery Scan on product_pricing_type_5 (cost=915.72..929.54 rows=691 width=36) (never executed)

448. 0.000 0.000 ↓ 0.0

Aggregate (cost=915.72..922.63 rows=691 width=36) (never executed)

449. 0.000 0.000 ↓ 0.0

Hash Join (cost=406.25..912.26 rows=692 width=16) (never executed)

450. 0.000 0.000 ↓ 0.0

Hash Join (cost=90.44..591.25 rows=692 width=25) (never executed)

451. 0.000 0.000 ↓ 0.0

Index Scan using index_values_on_company_id_subject_type on values values_5 (cost=0.43..498.42 rows=692 width=12) (never executed)

  • Index Cond: ((company_id = 115) AND ((subject_type)::text = 'Product'::text))
452. 0.000 0.000 ↓ 0.0

Hash (cost=88.53..88.53 rows=119 width=17) (never executed)

453. 0.000 0.000 ↓ 0.0

Seq Scan on fields f_5 (cost=0..88.53 rows=119 width=17) (never executed)

  • Filter: ((deleted_at IS NULL) AND ((name)::text = 'Pricing Type'::text))
454. 0.000 0.000 ↓ 0.0

Hash (cost=205.39..205.39 rows=7,361 width=20) (never executed)

455. 0.000 0.000 ↓ 0.0

Seq Scan on options product_pricing_type_options_5 (cost=0..205.39 rows=7,361 width=20) (never executed)

  • Filter: (deleted_at IS NULL)
456. 0.000 0.000 ↓ 0.0

Index Scan using index_io_members_on_io_id_user_id on io_members io_members_5 (cost=0.29..0.64 rows=2 width=20) (never executed)

  • Index Cond: (ios_5.id = io_id)
457. 0.000 0.000 ↓ 0.0

Hash (cost=568.83..568.83 rows=7,502 width=20) (never executed)

458. 0.000 0.000 ↓ 0.0

Seq Scan on products dis_sub_prod_2_5 (cost=0..568.83 rows=7,502 width=20) (never executed)

  • Filter: (level = 2)
459. 0.000 0.000 ↓ 0.0

Hash (cost=220.6..220.6 rows=4,260 width=17) (never executed)

460. 0.000 0.000 ↓ 0.0

Seq Scan on users users_15 (cost=0..220.6 rows=4,260 width=17) (never executed)