explain.depesz.com

PostgreSQL's explain analyze made readable

Result: p2s2

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

Hash Left Join (cost=58,005.06..922,446.91 rows=3,593 width=5,962) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (tmc_cp.company_id)::text) AND ((tmc.contact_id)::text = (tmc_cp.contact_id)::text))
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=46,543.78..126,390.10 rows=3,593 width=3,742) (actual rows= loops=)

  • Join Filter: ((tmc.company_id)::text = (si.company_id)::text)
3. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=46,543.36..123,061.84 rows=3,593 width=3,719) (actual rows= loops=)

  • Hash Cond: ((si.company_id)::text = (pfc.company_id)::text)
  • Join Filter: (((si.project_for__contact_id IS NOT NULL) AND ((pfc.contact_id)::text = (si.project_for__contact_id)::text)) OR ((si.project_for__contact_id IS NULL) AND ((pfc.contact_id)::text = (task_project.project_for__contact_id)::text)))
4. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=44,035.08..73,251.71 rows=3,593 width=3,735) (actual rows= loops=)

  • Hash Cond: (((c.company_id)::text = (si.company_id)::text) AND ((c.client_id)::text = (si.client_id)::text))
5. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=11,832.38..40,822.69 rows=437 width=1,803) (actual rows= loops=)

  • Hash Cond: (((c.company_id)::text = (cpe.company_id)::text) AND ((cp_1.employee_id)::text = (cpe.employee_id)::text))
6. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=11,808.70..40,796.72 rows=437 width=1,780) (actual rows= loops=)

  • Hash Cond: ((c.contact_id)::text = (cr.b__contact_id)::text)
7. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=5,661.90..34,640.48 rows=437 width=1,747) (actual rows= loops=)

  • Join Filter: (((cp_1.company_id)::text = (c.company_id)::text) AND ((cp_1.client_id)::text = (c.client_id)::text))
8. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=3,831.66..32,456.82 rows=437 width=1,714) (actual rows= loops=)

  • Hash Cond: (((c.company_id)::text = (coc.company_id)::text) AND ((co.contact_id)::text = (coc.contact_id)::text))
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,321.36..29,944.22 rows=437 width=1,730) (actual rows= loops=)

  • Join Filter: (((cae.company_id)::text = (c.company_id)::text) AND ((cae.employee_id)::text = (cm.associate__employee_id)::text))
10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,316.90..29,882.36 rows=437 width=1,707) (actual rows= loops=)

  • Join Filter: (((cme.company_id)::text = (c.company_id)::text) AND ((cme.employee_id)::text = (cm.manager__employee_id)::text))
11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,312.45..29,820.50 rows=437 width=1,684) (actual rows= loops=)

  • Hash Cond: (((c.company_id)::text = (co.company_id)::text) AND ((cm.office_id)::text = (co.office_id)::text))
12. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,308.43..29,814.19 rows=437 width=1,643) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=1,305.50..2,574.46 rows=437 width=587) (actual rows= loops=)

  • Hash Cond: (((cm.company_id)::text = (c.company_id)::text) AND ((cm.client_id)::text = (c.client_id)::text))
14. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on client_main cm (cost=24.01..1,290.54 rows=463 width=505) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ix_client_main$company_id" (cost=0.00..23.89 rows=463 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
16. 0.000 0.000 ↓ 0.0

Hash (cost=1,274.94..1,274.94 rows=437 width=148) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on client c (cost=19.80..1,274.94 rows=437 width=148) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on client_ix1 (cost=0.00..19.70 rows=437 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
19. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.94..62.32 rows=1 width=1,122) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.52..54.85 rows=1 width=1,093) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=2.10..47.45 rows=1 width=1,059) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.68..39.74 rows=1 width=414) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.26..32.04 rows=1 width=315) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.84..24.28 rows=1 width=312) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Scan using contact_pk on contact c_1 (cost=0.42..16.53 rows=1 width=294) (actual rows= loops=)

  • Index Cond: ((contact_id)::text = (c.contact_id)::text)
  • Filter: ((NOT is_deleted) AND ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text) AND ((company_id)::text = (c.company_id)::text))
26.          

SubPlan (for Index Scan)

27. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.42..8.45 rows=1 width=65) (actual rows= loops=)

  • Group Key: ni.contact_id
28. 0.000 0.000 ↓ 0.0

Index Scan using national_identity_uk1 on national_identity ni (cost=0.42..8.44 rows=1 width=44) (actual rows= loops=)

  • Index Cond: ((contact_id)::text = (c_1.contact_id)::text)
29. 0.000 0.000 ↓ 0.0

Index Scan using contact_image_uk1 on contact_image ci (cost=0.42..7.74 rows=1 width=84) (actual rows= loops=)

  • Index Cond: ((contact_id)::text = (c_1.contact_id)::text)
  • Filter: (((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text) AND ((company_id)::text = (c_1.company_id)::text))
30. 0.000 0.000 ↓ 0.0

Index Scan using contact_data_ix1 on contact_data cd (cost=0.42..7.74 rows=1 width=69) (actual rows= loops=)

  • Index Cond: ((contact_id)::text = (c_1.contact_id)::text)
  • Filter: (((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text) AND ((data_type_id)::text = 'UNKNOWN'::text) AND ((company_id)::text = (c_1.company_id)::text))
31. 0.000 0.000 ↓ 0.0

Index Scan using contact_primary_uk1 on contact_primary cp (cost=0.42..7.70 rows=1 width=165) (actual rows= loops=)

  • Index Cond: ((contact_id)::text = (c_1.contact_id)::text)
  • Filter: (((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text) AND ((company_id)::text = (c_1.company_id)::text))
32. 0.000 0.000 ↓ 0.0

Index Scan using contact_address_pk on contact_address pca (cost=0.42..7.71 rows=1 width=678) (actual rows= loops=)

  • Index Cond: ((contact_address_id)::text = (cp.contact_address_id)::text)
33. 0.000 0.000 ↓ 0.0

Index Scan using contact_email_pk on contact_email pce (cost=0.42..7.40 rows=1 width=67) (actual rows= loops=)

  • Index Cond: ((contact_email_id)::text = (cp.contact_email_id)::text)
34. 0.000 0.000 ↓ 0.0

Index Scan using contact_phone_pk on contact_phone pcp (cost=0.42..7.47 rows=1 width=62) (actual rows= loops=)

  • Index Cond: ((contact_phone_id)::text = (cp.contact_phone_id)::text)
35. 0.000 0.000 ↓ 0.0

Hash (cost=3.99..3.99 rows=2 width=107) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Seq Scan on office co (cost=0.00..3.99 rows=2 width=107) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text))
37. 0.000 0.000 ↓ 0.0

Materialize (cost=4.45..23.63 rows=5 width=89) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on employee cme (cost=4.45..23.61 rows=5 width=89) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
39. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ux_employee$company_id$employee_id" (cost=0.00..4.45 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
40. 0.000 0.000 ↓ 0.0

Materialize (cost=4.45..23.63 rows=5 width=89) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on employee cae (cost=4.45..23.61 rows=5 width=89) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
42. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ux_employee$company_id$employee_id" (cost=0.00..4.45 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
43. 0.000 0.000 ↓ 0.0

Hash (cost=2,498.16..2,498.16 rows=810 width=83) (actual rows= loops=)

44. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on contact coc (cost=34.70..2,498.16 rows=810 width=83) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
45. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on contact_ix1 (cost=0.00..34.50 rows=810 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
46. 0.000 0.000 ↓ 0.0

Materialize (cost=1,830.23..2,176.01 rows=1 width=99) (actual rows= loops=)

47. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,830.23..2,176.01 rows=1 width=99) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Index Only Scan using "ix_company$company_id$is_deleted" on company company_1 (cost=0.28..4.30 rows=1 width=33) (actual rows= loops=)

  • Index Cond: ((company_id = '5763A3F960E14225A891CD534E62038F'::text) AND (is_deleted = false))
  • Filter: (NOT is_deleted)
49. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,829.95..2,171.70 rows=1 width=99) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,829.53..2,169.80 rows=1 width=132) (actual rows= loops=)

  • Hash Cond: (((client_partner.client_id)::text = (cp_1.client_id)::text) AND ((max(client_partner.date_effective)) = cp_1.date_effective))
51. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,104.33..1,239.09 rows=13,476 width=37) (actual rows= loops=)

  • Group Key: client_partner.client_id
52. 0.000 0.000 ↓ 0.0

Seq Scan on client_partner (cost=0.00..1,027.59 rows=15,347 width=37) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND (date_effective <= ('now'::cstring)::date))
53. 0.000 0.000 ↓ 0.0

Hash (cost=718.25..718.25 rows=464 width=103) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on client_partner cp_1 (cost=19.88..718.25 rows=464 width=103) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
55. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ix_client_partner$company_id" (cost=0.00..19.77 rows=464 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
56. 0.000 0.000 ↓ 0.0

Index Scan using client_pk on client c_2 (cost=0.42..1.89 rows=1 width=33) (actual rows= loops=)

  • Index Cond: ((client_id)::text = (client_partner.client_id)::text)
  • Filter: (NOT is_deleted)
57. 0.000 0.000 ↓ 0.0

Hash (cost=6,106.83..6,106.83 rows=3,198 width=66) (actual rows= loops=)

58. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6,010.36..6,106.83 rows=3,198 width=66) (actual rows= loops=)

  • Join Filter: ((contact_relationship_type.contact_relationship_type_id)::text = (cr.relationship_type_id)::text)
59. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6,010.07..6,041.47 rows=9 width=41) (actual rows= loops=)

60. 0.000 0.000 ↓ 0.0

HashAggregate (cost=6,010.07..6,012.07 rows=200 width=8) (actual rows= loops=)

  • Group Key: min(contact_relationship.created)
61. 0.000 0.000 ↓ 0.0

HashAggregate (cost=5,866.14..5,930.11 rows=6,397 width=41) (actual rows= loops=)

  • Group Key: contact_relationship.b__contact_id
62. 0.000 0.000 ↓ 0.0

Hash Join (cost=6.99..5,834.15 rows=6,397 width=41) (actual rows= loops=)

  • Hash Cond: ((contact_relationship.relationship_type_id)::text = (contact_relationship_type_1.contact_relationship_type_id)::text)
63. 0.000 0.000 ↓ 0.0

Seq Scan on contact_relationship (cost=0.00..5,539.37 rows=106,623 width=74) (actual rows= loops=)

  • Filter: (NOT is_deleted)
64. 0.000 0.000 ↓ 0.0

Hash (cost=6.88..6.88 rows=9 width=33) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Seq Scan on contact_relationship_type contact_relationship_type_1 (cost=0.00..6.88 rows=9 width=33) (actual rows= loops=)

  • Filter: ((system_id)::text = 'TAXMATTERSCONTACT'::text)
66. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..6.92 rows=9 width=33) (actual rows= loops=)

67. 0.000 0.000 ↓ 0.0

Seq Scan on contact_relationship_type (cost=0.00..6.88 rows=9 width=33) (actual rows= loops=)

  • Filter: ((system_id)::text = 'TAXMATTERSCONTACT'::text)
68. 0.000 0.000 ↓ 0.0

Index Scan using "ix_contact_relationship$created" on contact_relationship cr (cost=0.29..7.25 rows=1 width=107) (actual rows= loops=)

  • Index Cond: (created = (min(contact_relationship.created)))
  • Filter: (NOT is_deleted)
69. 0.000 0.000 ↓ 0.0

Hash (cost=23.61..23.61 rows=5 width=89) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on employee cpe (cost=4.45..23.61 rows=5 width=89) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
71. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ux_employee$company_id$employee_id" (cost=0.00..4.45 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
72. 0.000 0.000 ↓ 0.0

Hash (cost=32,148.80..32,148.80 rows=3,593 width=1,998) (actual rows= loops=)

73. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=29,971.39..32,148.80 rows=3,593 width=1,998) (actual rows= loops=)

  • Hash Cond: (((task_project.company_id)::text = (tpet.company_id)::text) AND ((tpe.engagement_template_id)::text = (tpet.engagement_template_id)::text))
74. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=29,932.91..32,091.39 rows=3,593 width=1,997) (actual rows= loops=)

  • Hash Cond: ((task_project.engagement_id)::text = (tpe.engagement_id)::text)
75. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=28,642.85..30,791.89 rows=3,593 width=1,944) (actual rows= loops=)

  • Hash Cond: (((task_project.company_id)::text = (tptd.company_id)::text) AND ((task_project.tracking_description_id)::text = (tptd.tracking_description_id)::text))
76. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=28,615.60..30,745.78 rows=3,593 width=1,967) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (task_project.company_id)::text) AND ((si.task_project__schedule_item_id)::text = (task_project.schedule_item_id)::text))
77. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=22,364.98..24,476.30 rows=3,593 width=1,760) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (pt.company_id)::text) AND ((si.project_template_id)::text = (pt.project_template_id)::text))
78. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=22,276.60..24,369.06 rows=3,593 width=1,728) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (re.company_id)::text) AND ((si.responsible__employee_id)::text = (re.employee_id)::text))
79. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=22,252.92..24,326.51 rows=3,593 width=1,705) (actual rows= loops=)

  • Merge Cond: ((si.schedule_item_id)::text = (sia_1.schedule_item_id)::text)
80. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=17,269.35..19,249.88 rows=3,593 width=1,641) (actual rows= loops=)

  • Merge Cond: ((si.schedule_item_id)::text = (sia.schedule_item_id)::text)
81. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=8,227.88..8,375.16 rows=3,593 width=1,577) (actual rows= loops=)

  • Merge Cond: ((si.schedule_item_id)::text = (sid.schedule_item_id)::text)
82. 0.000 0.000 ↓ 0.0

Sort (cost=7,928.25..7,937.24 rows=3,593 width=1,481) (actual rows= loops=)

  • Sort Key: si.schedule_item_id
83. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,633.55..7,716.07 rows=3,593 width=1,481) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (et.company_id)::text) AND ((e.engagement_template_id)::text = (et.engagement_template_id)::text))
84. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=1,595.07..7,658.65 rows=3,593 width=1,447) (actual rows= loops=)

  • Hash Cond: ((si.engagement_id)::text = (e.engagement_id)::text)
85. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=305.01..6,359.16 rows=3,593 width=1,394) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (a.company_id)::text) AND ((si.activity_id)::text = (a.activity_id)::text))
86. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=247.79..6,283.07 rows=3,593 width=1,361) (actual rows= loops=)

  • Hash Cond: (((si.company_id)::text = (td.company_id)::text) AND ((si.tracking_description_id)::text = (td.tracking_description_id)::text))
87. 0.000 0.000 ↓ 0.0

Nested Loop (cost=220.55..6,236.96 rows=3,593 width=1,340) (actual rows= loops=)

88. 0.000 0.000 ↓ 0.0

Index Only Scan using "ix_company$company_id$is_deleted" on company (cost=0.28..4.30 rows=1 width=33) (actual rows= loops=)

  • Index Cond: ((company_id = '5763A3F960E14225A891CD534E62038F'::text) AND (is_deleted = false))
  • Filter: (NOT is_deleted)
89. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item si (cost=220.26..6,196.73 rows=3,593 width=1,340) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
90. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_ix1 (cost=0.00..219.36 rows=3,593 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
91. 0.000 0.000 ↓ 0.0

Hash (cost=27.16..27.16 rows=6 width=87) (actual rows= loops=)

92. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tracking_description td (cost=4.46..27.16 rows=6 width=87) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
93. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on tracking_description_ix1 (cost=0.00..4.46 rows=6 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
94. 0.000 0.000 ↓ 0.0

Hash (cost=56.72..56.72 rows=33 width=99) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on activity a (cost=4.53..56.72 rows=33 width=99) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
96. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on activity_ix1 (cost=0.00..4.52 rows=33 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
97. 0.000 0.000 ↓ 0.0

Hash (cost=1,088.36..1,088.36 rows=16,136 width=86) (actual rows= loops=)

98. 0.000 0.000 ↓ 0.0

Seq Scan on engagement e (cost=0.00..1,088.36 rows=16,136 width=86) (actual rows= loops=)

  • Filter: (NOT is_deleted)
99. 0.000 0.000 ↓ 0.0

Hash (cost=38.15..38.15 rows=22 width=100) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on engagement_template et (cost=4.45..38.15 rows=22 width=100) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
101. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on engagement_template_ix1 (cost=0.00..4.44 rows=22 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
102. 0.000 0.000 ↓ 0.0

Materialize (cost=299.63..420.63 rows=2,847 width=129) (actual rows= loops=)

103. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=299.63..385.04 rows=2,847 width=162) (actual rows= loops=)

  • Group Key: sid.schedule_item_id
104. 0.000 0.000 ↓ 0.0

Sort (cost=299.63..306.75 rows=2,847 width=104) (actual rows= loops=)

  • Sort Key: sid.schedule_item_id
105. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.98..136.28 rows=2,847 width=104) (actual rows= loops=)

  • Hash Cond: ((sid.department_id)::text = (d.department_id)::text)
106. 0.000 0.000 ↓ 0.0

Seq Scan on schedule_item_department sid (cost=0.00..123.47 rows=2,847 width=66) (actual rows= loops=)

107. 0.000 0.000 ↓ 0.0

Hash (cost=3.88..3.88 rows=88 width=71) (actual rows= loops=)

108. 0.000 0.000 ↓ 0.0

Seq Scan on department d (cost=0.00..3.88 rows=88 width=71) (actual rows= loops=)

109. 0.000 0.000 ↓ 0.0

Materialize (cost=9,041.46..10,740.17 rows=42,991 width=97) (actual rows= loops=)

110. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=9,041.46..10,202.78 rows=42,991 width=130) (actual rows= loops=)

  • Group Key: sia.schedule_item_id
111. 0.000 0.000 ↓ 0.0

Sort (cost=9,041.46..9,170.58 rows=51,645 width=97) (actual rows= loops=)

  • Sort Key: sia.schedule_item_id
112. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,242.89..4,998.60 rows=51,645 width=97) (actual rows= loops=)

  • Hash Cond: ((sia.employee_id)::text = (e_1.employee_id)::text)
113. 0.000 0.000 ↓ 0.0

Seq Scan on schedule_item_assignment sia (cost=0.00..2,620.14 rows=51,645 width=66) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND (NOT is_secondary))
114. 0.000 0.000 ↓ 0.0

Hash (cost=1,754.06..1,754.06 rows=39,106 width=64) (actual rows= loops=)

115. 0.000 0.000 ↓ 0.0

Seq Scan on employee e_1 (cost=0.00..1,754.06 rows=39,106 width=64) (actual rows= loops=)

116. 0.000 0.000 ↓ 0.0

Materialize (cost=4,983.57..5,061.59 rows=2,078 width=97) (actual rows= loops=)

117. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4,983.57..5,035.61 rows=2,078 width=130) (actual rows= loops=)

  • Group Key: sia_1.schedule_item_id
118. 0.000 0.000 ↓ 0.0

Sort (cost=4,983.57..4,988.79 rows=2,087 width=97) (actual rows= loops=)

  • Sort Key: sia_1.schedule_item_id
119. 0.000 0.000 ↓ 0.0

Hash Join (cost=2,242.89..4,868.50 rows=2,087 width=97) (actual rows= loops=)

  • Hash Cond: ((sia_1.employee_id)::text = (e_2.employee_id)::text)
120. 0.000 0.000 ↓ 0.0

Seq Scan on schedule_item_assignment sia_1 (cost=0.00..2,620.14 rows=2,087 width=66) (actual rows= loops=)

  • Filter: ((NOT is_deleted) AND is_secondary)
121. 0.000 0.000 ↓ 0.0

Hash (cost=1,754.06..1,754.06 rows=39,106 width=64) (actual rows= loops=)

122. 0.000 0.000 ↓ 0.0

Seq Scan on employee e_2 (cost=0.00..1,754.06 rows=39,106 width=64) (actual rows= loops=)

123. 0.000 0.000 ↓ 0.0

Hash (cost=23.61..23.61 rows=5 width=89) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on employee re (cost=4.45..23.61 rows=5 width=89) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
125. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ux_employee$company_id$employee_id" (cost=0.00..4.45 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
126. 0.000 0.000 ↓ 0.0

Hash (cost=88.00..88.00 rows=25 width=98) (actual rows= loops=)

127. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on project_template pt (cost=4.48..88.00 rows=25 width=98) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
128. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on project_template_ix1 (cost=0.00..4.47 rows=25 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
129. 0.000 0.000 ↓ 0.0

Hash (cost=6,196.73..6,196.73 rows=3,593 width=207) (actual rows= loops=)

130. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item task_project (cost=220.26..6,196.73 rows=3,593 width=207) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
131. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_ix1 (cost=0.00..219.36 rows=3,593 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
132. 0.000 0.000 ↓ 0.0

Hash (cost=27.16..27.16 rows=6 width=76) (actual rows= loops=)

133. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on tracking_description tptd (cost=4.46..27.16 rows=6 width=76) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
134. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on tracking_description_ix1 (cost=0.00..4.46 rows=6 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
135. 0.000 0.000 ↓ 0.0

Hash (cost=1,088.36..1,088.36 rows=16,136 width=86) (actual rows= loops=)

136. 0.000 0.000 ↓ 0.0

Seq Scan on engagement tpe (cost=0.00..1,088.36 rows=16,136 width=86) (actual rows= loops=)

  • Filter: (NOT is_deleted)
137. 0.000 0.000 ↓ 0.0

Hash (cost=38.15..38.15 rows=22 width=100) (actual rows= loops=)

138. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on engagement_template tpet (cost=4.45..38.15 rows=22 width=100) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
139. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on engagement_template_ix1 (cost=0.00..4.44 rows=22 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
140. 0.000 0.000 ↓ 0.0

Hash (cost=2,498.16..2,498.16 rows=810 width=83) (actual rows= loops=)

141. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on contact pfc (cost=34.70..2,498.16 rows=810 width=83) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
  • Filter: (NOT is_deleted)
142. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on contact_ix1 (cost=0.00..34.50 rows=810 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
143. 0.000 0.000 ↓ 0.0

Index Scan using contact_pk on contact tmc (cost=0.42..0.91 rows=1 width=89) (actual rows= loops=)

  • Index Cond: ((contact_id)::text = (cr.a__contact_id)::text)
  • Filter: ((NOT is_deleted) AND ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text))
144. 0.000 0.000 ↓ 0.0

Hash (cost=11,451.75..11,451.75 rows=635 width=195) (actual rows= loops=)

145. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=34.18..11,451.75 rows=635 width=195) (actual rows= loops=)

146. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=33.76..6,707.53 rows=635 width=166) (actual rows= loops=)

147. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on contact_primary tmc_cp (cost=33.34..2,007.30 rows=635 width=132) (actual rows= loops=)

  • Recheck Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
148. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ix_contact_primary$company_id" (cost=0.00..33.18 rows=635 width=0) (actual rows= loops=)

  • Index Cond: ((company_id)::text = '5763A3F960E14225A891CD534E62038F'::text)
149. 0.000 0.000 ↓ 0.0

Index Scan using contact_email_pk on contact_email tmc_pce (cost=0.42..7.40 rows=1 width=67) (actual rows= loops=)

  • Index Cond: ((contact_email_id)::text = (tmc_cp.contact_email_id)::text)
150. 0.000 0.000 ↓ 0.0

Index Scan using contact_phone_pk on contact_phone tmc_pcp (cost=0.42..7.47 rows=1 width=62) (actual rows= loops=)

  • Index Cond: ((contact_phone_id)::text = (tmc_cp.contact_phone_id)::text)
151.          

SubPlan (for Hash Left Join)

152. 0.000 0.000 ↓ 0.0

Limit (cost=12.44..12.45 rows=1 width=50) (actual rows= loops=)

153. 0.000 0.000 ↓ 0.0

Sort (cost=12.44..12.45 rows=1 width=50) (actual rows= loops=)

  • Sort Key: sid_1.changed DESC, d_1.code DESC
154. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.31..12.43 rows=1 width=50) (actual rows= loops=)

  • Hash Cond: ((d_1.department_id)::text = (sid_1.department_id)::text)
155. 0.000 0.000 ↓ 0.0

Seq Scan on department d_1 (cost=0.00..3.88 rows=88 width=42) (actual rows= loops=)

156. 0.000 0.000 ↓ 0.0

Hash (cost=8.30..8.30 rows=1 width=41) (actual rows= loops=)

157. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_department_uk1 on schedule_item_department sid_1 (cost=0.28..8.30 rows=1 width=41) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
158. 0.000 0.000 ↓ 0.0

Limit (cost=12.44..12.45 rows=1 width=17) (actual rows= loops=)

159. 0.000 0.000 ↓ 0.0

Sort (cost=12.44..12.45 rows=1 width=17) (actual rows= loops=)

  • Sort Key: sid_2.changed DESC, d_2.code DESC
160. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.31..12.43 rows=1 width=17) (actual rows= loops=)

  • Hash Cond: ((d_2.department_id)::text = (sid_2.department_id)::text)
161. 0.000 0.000 ↓ 0.0

Seq Scan on department d_2 (cost=0.00..3.88 rows=88 width=42) (actual rows= loops=)

162. 0.000 0.000 ↓ 0.0

Hash (cost=8.30..8.30 rows=1 width=41) (actual rows= loops=)

163. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_department_uk1 on schedule_item_department sid_2 (cost=0.28..8.30 rows=1 width=41) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
164. 0.000 0.000 ↓ 0.0

Limit (cost=12.44..12.45 rows=1 width=38) (actual rows= loops=)

165. 0.000 0.000 ↓ 0.0

Sort (cost=12.44..12.45 rows=1 width=38) (actual rows= loops=)

  • Sort Key: sid_3.changed DESC, d_3.code DESC
166. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.31..12.43 rows=1 width=38) (actual rows= loops=)

  • Hash Cond: ((d_3.department_id)::text = (sid_3.department_id)::text)
167. 0.000 0.000 ↓ 0.0

Seq Scan on department d_3 (cost=0.00..3.88 rows=88 width=63) (actual rows= loops=)

168. 0.000 0.000 ↓ 0.0

Hash (cost=8.30..8.30 rows=1 width=41) (actual rows= loops=)

169. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_department_uk1 on schedule_item_department sid_3 (cost=0.28..8.30 rows=1 width=41) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
170. 0.000 0.000 ↓ 0.0

Limit (cost=8.44..8.45 rows=1 width=45) (actual rows= loops=)

171. 0.000 0.000 ↓ 0.0

Sort (cost=8.44..8.45 rows=1 width=45) (actual rows= loops=)

  • Sort Key: sia_2.sort_order, sia_2.created
172. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_assignment_ix1 on schedule_item_assignment sia_2 (cost=0.41..8.43 rows=1 width=45) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: (is_primary AND (NOT is_secondary) AND (NOT is_deleted))
173. 0.000 0.000 ↓ 0.0

Limit (cost=8.44..8.45 rows=1 width=45) (actual rows= loops=)

174. 0.000 0.000 ↓ 0.0

Sort (cost=8.44..8.45 rows=1 width=45) (actual rows= loops=)

  • Sort Key: sia_3.sort_order, sia_3.created
175. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_assignment_ix1 on schedule_item_assignment sia_3 (cost=0.41..8.43 rows=1 width=45) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: (is_primary AND is_secondary AND (NOT is_deleted))
176. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item (cost=4.46..24.13 rows=1 width=0) (actual rows= loops=)

  • Recheck Cond: ((task_project__schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: ((schedule_item_type_id)::text = 'PROJECT'::text)
177. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_ix18 (cost=0.00..4.46 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((task_project__schedule_item_id)::text = (si.schedule_item_id)::text)
178. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item schedule_item_1 (cost=613.34..7,809.99 rows=19,732 width=32) (actual rows= loops=)

  • Recheck Cond: ((schedule_item_type_id)::text = 'PROJECT'::text)
179. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on "ix_schedule_item$schedule_item_type_id" (cost=0.00..608.41 rows=19,732 width=0) (actual rows= loops=)

  • Index Cond: ((schedule_item_type_id)::text = 'PROJECT'::text)
180. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=40.96..40.99 rows=1 width=65) (actual rows= loops=)

  • Group Key: p.schedule_item_id
181. 0.000 0.000 ↓ 0.0

Sort (cost=40.96..40.97 rows=1 width=43) (actual rows= loops=)

  • Sort Key: p.schedule_item_id
182. 0.000 0.000 ↓ 0.0

Nested Loop (cost=13.31..40.95 rows=1 width=43) (actual rows= loops=)

183. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item p (cost=8.85..16.78 rows=1 width=38) (actual rows= loops=)

  • Recheck Cond: (((schedule_item_id)::text = (si.schedule_item_id)::text) OR ((schedule_item_id)::text = (si.task_project__schedule_item_id)::text))
  • Filter: ((NOT is_deleted) AND ((schedule_item_type_id)::text = 'PROJECT'::text))
184. 0.000 0.000 ↓ 0.0

BitmapOr (cost=8.85..8.85 rows=2 width=0) (actual rows= loops=)

185. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_uk18 (cost=0.00..4.43 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
186. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_uk18 (cost=0.00..4.43 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.task_project__schedule_item_id)::text)
187. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item t (cost=4.46..24.13 rows=4 width=38) (actual rows= loops=)

  • Recheck Cond: ((task_project__schedule_item_id)::text = (p.schedule_item_id)::text)
  • Filter: ((NOT is_deleted) AND ((schedule_item_type_id)::text = 'TASK'::text))
188. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_ix18 (cost=0.00..4.46 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((task_project__schedule_item_id)::text = (p.schedule_item_id)::text)
189. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=4.87..32.64 rows=1 width=41) (actual rows= loops=)

  • Group Key: p_1.schedule_item_id
190. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.87..32.61 rows=4 width=33) (actual rows= loops=)

191. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_uk18 on schedule_item p_1 (cost=0.42..8.44 rows=1 width=33) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: ((NOT is_deleted) AND ((schedule_item_type_id)::text = 'PROJECT'::text))
192. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item t_1 (cost=4.46..24.13 rows=4 width=33) (actual rows= loops=)

  • Recheck Cond: ((task_project__schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: ((NOT is_deleted) AND ((schedule_item_type_id)::text = 'TASK'::text))
193. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_ix18 (cost=0.00..4.46 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((task_project__schedule_item_id)::text = (si.schedule_item_id)::text)
194. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=5.29..66.33 rows=1 width=41) (actual rows= loops=)

  • Group Key: p_2.schedule_item_id
195. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.29..66.32 rows=1 width=33) (actual rows= loops=)

196. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.87..57.87 rows=1 width=33) (actual rows= loops=)

197. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on schedule_item t_2 (cost=4.46..24.13 rows=4 width=66) (actual rows= loops=)

  • Recheck Cond: ((task_project__schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: ((NOT is_deleted) AND ((schedule_item_type_id)::text = 'TASK'::text))
198. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on schedule_item_ix18 (cost=0.00..4.46 rows=5 width=0) (actual rows= loops=)

  • Index Cond: ((task_project__schedule_item_id)::text = (si.schedule_item_id)::text)
199. 0.000 0.000 ↓ 0.0

Index Scan using tracking_description_pk on tracking_description td_1 (cost=0.41..8.43 rows=1 width=33) (actual rows= loops=)

  • Index Cond: ((tracking_description_id)::text = (t_2.tracking_description_id)::text)
  • Filter: ((system_id)::text = ANY ('{CANCELED,COMPLETED}'::text[]))
200. 0.000 0.000 ↓ 0.0

Index Scan using schedule_item_uk18 on schedule_item p_2 (cost=0.42..8.44 rows=1 width=33) (actual rows= loops=)

  • Index Cond: ((schedule_item_id)::text = (si.schedule_item_id)::text)
  • Filter: ((NOT is_deleted) AND ((schedule_item_type_id)::text = 'PROJECT'::text))