explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vg9H

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 7,533.812 ↑ 1.0 40 1

Sort (cost=261,998,703.48..261,998,703.58 rows=40 width=132) (actual time=7,533.810..7,533.812 rows=40 loops=1)

  • Sort Key: cte0.c1 DESC, cte0.c7 NULLS FIRST
  • Sort Method: quicksort Memory: 36kB
2.          

CTE account_activity_cte

3. 0.004 7,530.221 ↑ 1.0 40 1

Limit (cost=261,998,166.76..261,998,166.86 rows=40 width=100) (actual time=7,530.216..7,530.221 rows=40 loops=1)

4.          

CTE account_activity_count_cte_meeting_current

5. 12.923 109.094 ↓ 1.1 1,861 1

GroupAggregate (cost=1,731,261.89..1,731,677.60 rows=1,710 width=12) (actual time=91.044..109.094 rows=1,861 loops=1)

  • Group Key: t2273_meetingactivityaccountfact.c9010_accountid
6. 38.191 96.171 ↓ 1.3 67,811 1

Sort (cost=1,731,261.89..1,731,394.76 rows=53,149 width=8) (actual time=91.024..96.171 rows=67,811 loops=1)

  • Sort Key: t2273_meetingactivityaccountfact.c9010_accountid
  • Sort Method: external merge Disk: 1,200kB
7. 57.670 57.980 ↓ 1.3 67,811 1

Index Scan using "idx_activitydate_issharedp_del_P_sentha" on t2273_meetingactivityaccountfact (cost=0.42..1,727,090.29 rows=53,149 width=8) (actual time=0.355..57.980 rows=67,811 loops=1)

  • Index Cond: ((c8986_activitydate >= '1561532400000'::bigint) AND (c8986_activitydate < '1593241200000'::bigint) AND (end_stamp > '1593173652000'::bigint) AND (start_stamp <= '1593173652000'::bigint))
  • Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (alternatives: SubPlan 3 or hashed SubPlan 4))
  • Rows Removed by Filter: 6,979
8.          

SubPlan (for Index Scan)

9. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.32..15.78 rows=1 width=0) (never executed)

  • Hash Cond: (t859_userroledim.sid = t786_userrolehierarchy.c4812_user_role_id)
10. 0.000 0.000 ↓ 0.0 0

Seq Scan on t859_userroledim (cost=0.00..7.35 rows=29 width=4) (never executed)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
11. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.30..8.30 rows=1 width=4) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_37_t786_userrolehierarchy_sid_c4815_ancestor_role_id_end_st on t786_userrolehierarchy (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: ((sid = t2273_meetingactivityaccountfact.c9004_activityownersfuserid) AND (c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
13. 0.086 0.260 ↓ 1.5 359 1

Hash Join (cost=23.72..97.23 rows=246 width=4) (actual time=0.097..0.260 rows=359 loops=1)

  • Hash Cond: (t786_userrolehierarchy_1.c4812_user_role_id = t859_userroledim_1.sid)
14. 0.100 0.132 ↑ 1.0 359 1

Bitmap Heap Scan on t786_userrolehierarchy t786_userrolehierarchy_1 (cost=16.01..88.47 rows=364 width=8) (actual time=0.043..0.132 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
15. 0.032 0.032 ↑ 1.0 359 1

Bitmap Index Scan on idx_35_t786_userrolehierarchy_c4815_ancestor_role_id_end_stamp_ (cost=0.00..15.92 rows=364 width=0) (actual time=0.032..0.032 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
16. 0.007 0.042 ↓ 1.5 44 1

Hash (cost=7.35..7.35 rows=29 width=4) (actual time=0.042..0.042 rows=44 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
17. 0.035 0.035 ↓ 1.5 44 1

Seq Scan on t859_userroledim t859_userroledim_1 (cost=0.00..7.35 rows=29 width=4) (actual time=0.005..0.035 rows=44 loops=1)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
  • Rows Removed by Filter: 84
18. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_14_t773_userdim_sid_end_stamp_start_stamp_null on t773_userdim (cost=0.28..8.30 rows=1 width=0) (never executed)

  • Index Cond: ((sid = t2273_meetingactivityaccountfact.c9004_activityownersfuserid) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (c4570_userroleid IS NULL) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
19. 0.035 0.050 ↑ 2.5 27 1

Bitmap Heap Scan on t773_userdim t773_userdim_1 (cost=4.98..53.05 rows=68 width=4) (actual time=0.023..0.050 rows=27 loops=1)

  • Recheck Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
  • Rows Removed by Filter: 9
  • Heap Blocks: exact=23
20. 0.015 0.015 ↑ 1.9 36 1

Bitmap Index Scan on idx_15_t773_userdim_c4570_userroleid_end_stamp_start_stamp_null (cost=0.00..4.97 rows=69 width=0) (actual time=0.015..0.015 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
21.          

CTE account_activity_count_cte_meeting_upcoming

22. 1.022 6.349 ↑ 3.2 519 1

GroupAggregate (cost=195,437.70..195,498.81 rows=1,660 width=12) (actual time=5.085..6.349 rows=519 loops=1)

  • Group Key: t2273_meetingactivityaccountfact_1.c9010_accountid
23. 1.110 5.327 ↑ 1.3 4,596 1

Sort (cost=195,437.70..195,452.54 rows=5,935 width=8) (actual time=5.076..5.327 rows=4,596 loops=1)

  • Sort Key: t2273_meetingactivityaccountfact_1.c9010_accountid
  • Sort Method: quicksort Memory: 408kB
24. 3.062 4.217 ↑ 1.3 4,596 1

Bitmap Heap Scan on t2273_meetingactivityaccountfact t2273_meetingactivityaccountfact_1 (cost=491.86..195,065.72 rows=5,935 width=8) (actual time=1.289..4.217 rows=4,596 loops=1)

  • Recheck Cond: ((c8986_activitydate >= '1593241200000'::bigint) AND (c8986_activitydate < '1595833200000'::bigint) AND (end_stamp > '1593173652000'::bigint) AND (start_stamp <= '1593173652000'::bigint) AND c8998_isshared AND (NOT deleted))
  • Filter: ((alternatives: SubPlan 6 or hashed SubPlan 7) OR (alternatives: SubPlan 8 or hashed SubPlan 9))
  • Rows Removed by Filter: 170
  • Heap Blocks: exact=1,124
25. 0.813 0.813 ↑ 1.7 4,766 1

Bitmap Index Scan on "idx_activitydate_issharedp_del_P_sentha" (cost=0.00..490.38 rows=7,914 width=0) (actual time=0.813..0.813 rows=4,766 loops=1)

  • Index Cond: ((c8986_activitydate >= '1593241200000'::bigint) AND (c8986_activitydate < '1595833200000'::bigint) AND (end_stamp > '1593173652000'::bigint) AND (start_stamp <= '1593173652000'::bigint))
26.          

SubPlan (for Bitmap Heap Scan)

27. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.32..15.78 rows=1 width=0) (never executed)

  • Hash Cond: (t859_userroledim_2.sid = t786_userrolehierarchy_2.c4812_user_role_id)
28. 0.000 0.000 ↓ 0.0 0

Seq Scan on t859_userroledim t859_userroledim_2 (cost=0.00..7.35 rows=29 width=4) (never executed)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
29. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.30..8.30 rows=1 width=4) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_37_t786_userrolehierarchy_sid_c4815_ancestor_role_id_end_st on t786_userrolehierarchy t786_userrolehierarchy_2 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: ((sid = t2273_meetingactivityaccountfact_1.c9004_activityownersfuserid) AND (c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
31. 0.094 0.284 ↓ 1.5 359 1

Hash Join (cost=23.72..97.23 rows=246 width=4) (actual time=0.102..0.284 rows=359 loops=1)

  • Hash Cond: (t786_userrolehierarchy_3.c4812_user_role_id = t859_userroledim_3.sid)
32. 0.112 0.143 ↑ 1.0 359 1

Bitmap Heap Scan on t786_userrolehierarchy t786_userrolehierarchy_3 (cost=16.01..88.47 rows=364 width=8) (actual time=0.043..0.143 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
33. 0.031 0.031 ↑ 1.0 359 1

Bitmap Index Scan on idx_35_t786_userrolehierarchy_c4815_ancestor_role_id_end_stamp_ (cost=0.00..15.92 rows=364 width=0) (actual time=0.031..0.031 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
34. 0.007 0.047 ↓ 1.5 44 1

Hash (cost=7.35..7.35 rows=29 width=4) (actual time=0.047..0.047 rows=44 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
35. 0.040 0.040 ↓ 1.5 44 1

Seq Scan on t859_userroledim t859_userroledim_3 (cost=0.00..7.35 rows=29 width=4) (actual time=0.007..0.040 rows=44 loops=1)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
  • Rows Removed by Filter: 84
36. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_14_t773_userdim_sid_end_stamp_start_stamp_null on t773_userdim t773_userdim_2 (cost=0.28..8.30 rows=1 width=0) (never executed)

  • Index Cond: ((sid = t2273_meetingactivityaccountfact_1.c9004_activityownersfuserid) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (c4570_userroleid IS NULL) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
37. 0.038 0.058 ↑ 2.5 27 1

Bitmap Heap Scan on t773_userdim t773_userdim_3 (cost=4.98..53.05 rows=68 width=4) (actual time=0.030..0.058 rows=27 loops=1)

  • Recheck Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
  • Rows Removed by Filter: 9
  • Heap Blocks: exact=23
38. 0.020 0.020 ↑ 1.9 36 1

Bitmap Index Scan on idx_15_t773_userdim_c4570_userroleid_end_stamp_start_stamp_null (cost=0.00..4.97 rows=69 width=0) (actual time=0.020..0.020 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
39.          

CTE account_activity_count_cte_email_sent_current

40. 369.202 3,789.182 ↓ 4.8 5,838 1

GroupAggregate (cost=144,118,301.15..144,146,723.26 rows=1,208 width=12) (actual time=3,228.256..3,789.182 rows=5,838 loops=1)

  • Group Key: t2608_emailactivityaccountfact_copy_sentha.c9638_accountid
41. 655.297 3,419.980 ↑ 1.9 2,047,388 1

Sort (cost=144,118,301.15..144,127,771.16 rows=3,788,004 width=8) (actual time=3,228.154..3,419.980 rows=2,047,388 loops=1)

  • Sort Key: t2608_emailactivityaccountfact_copy_sentha.c9638_accountid
  • Sort Method: external merge Disk: 36,112kB
42. 2,764.330 2,764.683 ↑ 1.9 2,047,388 1

Index Scan using idx_isinternal_sentha1 on t2608_emailactivityaccountfact_copy_sentha (cost=0.56..143,600,825.77 rows=3,788,004 width=8) (actual time=0.401..2,764.683 rows=2,047,388 loops=1)

  • Index Cond: ((c9660_isinternalinitiated = true) AND (end_stamp > '1593173652000'::bigint) AND (start_stamp <= '1593173652000'::bigint))
  • Filter: (c9660_isinternalinitiated AND (c9653_activitydate >= '1561532400000'::bigint) AND (c9653_activitydate < '1593241200000'::bigint) AND ((alternatives: SubPlan 11 or hashed SubPlan 12) OR (alternatives: SubPlan 13 or hashed SubPlan 14)))
  • Rows Removed by Filter: 3,341,669
43.          

SubPlan (for Index Scan)

44. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.32..15.78 rows=1 width=0) (never executed)

  • Hash Cond: (t859_userroledim_4.sid = t786_userrolehierarchy_4.c4812_user_role_id)
45. 0.000 0.000 ↓ 0.0 0

Seq Scan on t859_userroledim t859_userroledim_4 (cost=0.00..7.35 rows=29 width=4) (never executed)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
46. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.30..8.30 rows=1 width=4) (never executed)

47. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_37_t786_userrolehierarchy_sid_c4815_ancestor_role_id_end_st on t786_userrolehierarchy t786_userrolehierarchy_4 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: ((sid = t2608_emailactivityaccountfact_copy_sentha.c9662_activityownersfuserid) AND (c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
48. 0.095 0.295 ↓ 1.5 359 1

Hash Join (cost=23.72..97.23 rows=246 width=4) (actual time=0.114..0.295 rows=359 loops=1)

  • Hash Cond: (t786_userrolehierarchy_5.c4812_user_role_id = t859_userroledim_5.sid)
49. 0.114 0.152 ↑ 1.0 359 1

Bitmap Heap Scan on t786_userrolehierarchy t786_userrolehierarchy_5 (cost=16.01..88.47 rows=364 width=8) (actual time=0.053..0.152 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
50. 0.038 0.038 ↑ 1.0 359 1

Bitmap Index Scan on idx_35_t786_userrolehierarchy_c4815_ancestor_role_id_end_stamp_ (cost=0.00..15.92 rows=364 width=0) (actual time=0.038..0.038 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
51. 0.008 0.048 ↓ 1.5 44 1

Hash (cost=7.35..7.35 rows=29 width=4) (actual time=0.048..0.048 rows=44 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
52. 0.040 0.040 ↓ 1.5 44 1

Seq Scan on t859_userroledim t859_userroledim_5 (cost=0.00..7.35 rows=29 width=4) (actual time=0.006..0.040 rows=44 loops=1)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
  • Rows Removed by Filter: 84
53. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_14_t773_userdim_sid_end_stamp_start_stamp_null on t773_userdim t773_userdim_4 (cost=0.28..8.30 rows=1 width=0) (never executed)

  • Index Cond: ((sid = t2608_emailactivityaccountfact_copy_sentha.c9662_activityownersfuserid) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (c4570_userroleid IS NULL) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
54. 0.039 0.058 ↑ 2.5 27 1

Bitmap Heap Scan on t773_userdim t773_userdim_5 (cost=4.98..53.05 rows=68 width=4) (actual time=0.029..0.058 rows=27 loops=1)

  • Recheck Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
  • Rows Removed by Filter: 9
  • Heap Blocks: exact=23
55. 0.019 0.019 ↑ 1.9 36 1

Bitmap Index Scan on idx_15_t773_userdim_c4570_userroleid_end_stamp_start_stamp_null (cost=0.00..4.97 rows=69 width=0) (actual time=0.019..0.019 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
56.          

CTE account_activity_count_cte_email_received_current

57. 436.280 3,377.676 ↓ 3.1 3,721 1

GroupAggregate (cost=106,786,569.40..106,807,563.02 rows=1,208 width=12) (actual time=2,742.488..3,377.676 rows=3,721 loops=1)

  • Group Key: t2608_emailactivityaccountfact_copy_sentha_1.c9638_accountid
58. 685.626 2,941.396 ↑ 1.3 2,138,476 1

Sort (cost=106,786,569.40..106,793,563.25 rows=2,797,538 width=8) (actual time=2,742.275..2,941.396 rows=2,138,476 loops=1)

  • Sort Key: t2608_emailactivityaccountfact_copy_sentha_1.c9638_accountid
  • Sort Method: external merge Disk: 37,712kB
59. 2,255.435 2,255.770 ↑ 1.3 2,138,476 1

Index Scan using idx_isinternal_sentha1 on t2608_emailactivityaccountfact_copy_sentha t2608_emailactivityaccountfact_copy_sentha_1 (cost=0.56..106,410,516.86 rows=2,797,538 width=8) (actual time=0.436..2,255.770 rows=2,138,476 loops=1)

  • Index Cond: ((c9660_isinternalinitiated = false) AND (end_stamp > '1593173652000'::bigint) AND (start_stamp <= '1593173652000'::bigint))
  • Filter: ((NOT c9660_isinternalinitiated) AND (c9653_activitydate >= '1561532400000'::bigint) AND (c9653_activitydate < '1593241200000'::bigint) AND ((alternatives: SubPlan 16 or hashed SubPlan 17) OR (alternatives: SubPlan 18 or hashed SubPlan 19)))
  • Rows Removed by Filter: 2,233,348
60.          

SubPlan (for Index Scan)

61. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=8.32..15.78 rows=1 width=0) (never executed)

  • Hash Cond: (t859_userroledim_6.sid = t786_userrolehierarchy_6.c4812_user_role_id)
62. 0.000 0.000 ↓ 0.0 0

Seq Scan on t859_userroledim t859_userroledim_6 (cost=0.00..7.35 rows=29 width=4) (never executed)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
63. 0.000 0.000 ↓ 0.0 0

Hash (cost=8.30..8.30 rows=1 width=4) (never executed)

64. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_37_t786_userrolehierarchy_sid_c4815_ancestor_role_id_end_st on t786_userrolehierarchy t786_userrolehierarchy_6 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: ((sid = t2608_emailactivityaccountfact_copy_sentha_1.c9662_activityownersfuserid) AND (c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
65. 0.094 0.283 ↓ 1.5 359 1

Hash Join (cost=23.72..97.23 rows=246 width=4) (actual time=0.102..0.283 rows=359 loops=1)

  • Hash Cond: (t786_userrolehierarchy_7.c4812_user_role_id = t859_userroledim_7.sid)
66. 0.111 0.144 ↑ 1.0 359 1

Bitmap Heap Scan on t786_userrolehierarchy t786_userrolehierarchy_7 (cost=16.01..88.47 rows=364 width=8) (actual time=0.046..0.144 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
67. 0.033 0.033 ↑ 1.0 359 1

Bitmap Index Scan on idx_35_t786_userrolehierarchy_c4815_ancestor_role_id_end_stamp_ (cost=0.00..15.92 rows=364 width=0) (actual time=0.033..0.033 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
68. 0.006 0.045 ↓ 1.5 44 1

Hash (cost=7.35..7.35 rows=29 width=4) (actual time=0.045..0.045 rows=44 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
69. 0.039 0.039 ↓ 1.5 44 1

Seq Scan on t859_userroledim t859_userroledim_7 (cost=0.00..7.35 rows=29 width=4) (actual time=0.006..0.039 rows=44 loops=1)

  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND ((c4994_portaltype IS NULL) OR (c4994_portaltype = 'None'::text)) AND (end_stamp = '32503680000000'::bigint))
  • Rows Removed by Filter: 84
70. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_14_t773_userdim_sid_end_stamp_start_stamp_null on t773_userdim t773_userdim_6 (cost=0.28..8.30 rows=1 width=0) (never executed)

  • Index Cond: ((sid = t2608_emailactivityaccountfact_copy_sentha_1.c9662_activityownersfuserid) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (c4570_userroleid IS NULL) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
71. 0.037 0.052 ↑ 2.5 27 1

Bitmap Heap Scan on t773_userdim t773_userdim_7 (cost=4.98..53.05 rows=68 width=4) (actual time=0.024..0.052 rows=27 loops=1)

  • Recheck Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
  • Rows Removed by Filter: 9
  • Heap Blocks: exact=23
72. 0.015 0.015 ↑ 1.9 36 1

Bitmap Index Scan on idx_15_t773_userdim_c4570_userroleid_end_stamp_start_stamp_null (cost=0.00..4.97 rows=69 width=0) (actual time=0.015..0.015 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
73.          

CTE filtered_accounts_cte

74. 13.685 202.265 ↑ 2.1 35,940 1

Hash Join (cost=59,298.97..84,990.69 rows=74,039 width=40) (actual time=140.399..202.265 rows=35,940 loops=1)

  • Hash Cond: (t1401_accountfact.sid = t2268_accountdim.sid)
75. 48.614 48.614 ↑ 1.4 35,940 1

Seq Scan on t1401_accountfact (cost=0.00..18,028.11 rows=51,628 width=4) (actual time=0.005..48.614 rows=35,940 loops=1)

  • Filter: ((NOT deleted) AND (start_stamp <= '1593173652000'::bigint) AND (end_stamp > '1593173652000'::bigint))
  • Rows Removed by Filter: 422,961
76. 9.243 139.966 ↑ 2.1 35,941 1

Hash (cost=57,786.71..57,786.71 rows=74,421 width=40) (actual time=139.966..139.966 rows=35,941 loops=1)

  • Buckets: 65,536 Batches: 2 Memory Usage: 1,801kB
77. 130.723 130.723 ↑ 2.1 35,941 1

Seq Scan on t2268_accountdim (cost=0.00..57,786.71 rows=74,421 width=40) (actual time=0.003..130.723 rows=35,941 loops=1)

  • Filter: ((NOT deleted) AND (start_stamp <= '1593173652000'::bigint) AND (end_stamp > '1593173652000'::bigint))
  • Rows Removed by Filter: 438,189
78. 1.146 7,530.217 ↑ 4,792,035.5 40 1

Sort (cost=9,031,713.38..9,510,916.92 rows=191,681,418 width=100) (actual time=7,530.215..7,530.217 rows=40 loops=1)

  • Sort Key: (CASE WHEN (cte0_1.c1 IS NULL) THEN '0'::bigint ELSE cte0_1.c1 END) DESC, cte4.c3 NULLS FIRST
  • Sort Method: top-N heapsort Memory: 34kB
79. 5.961 7,529.071 ↑ 30,595.6 6,265 1

Merge Right Join (cost=95,846.74..2,972,732.67 rows=191,681,418 width=100) (actual time=7,518.928..7,529.071 rows=6,265 loops=1)

  • Merge Cond: (cte4.c1 = (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 WHEN (cte1_1.c2 IS NOT NULL) THEN cte1_1.c2 WHEN (cte2.c2 IS NOT NULL) THEN cte2.c2 WHEN (cte3.c2 IS NOT NULL) THEN cte3.c2 ELSE NULL::integer END))
80. 14.893 228.664 ↑ 2.1 35,940 1

Sort (cost=10,507.05..10,692.15 rows=74,039 width=68) (actual time=225.491..228.664 rows=35,940 loops=1)

  • Sort Key: cte4.c1
  • Sort Method: quicksort Memory: 4,013kB
81. 213.771 213.771 ↑ 2.1 35,940 1

CTE Scan on filtered_accounts_cte cte4 (cost=0.00..1,480.78 rows=74,039 width=68) (actual time=140.401..213.771 rows=35,940 loops=1)

82. 0.683 7,294.446 ↑ 82.6 6,265 1

Materialize (cost=85,339.69..87,928.61 rows=517,785 width=48) (actual time=7,293.433..7,294.446 rows=6,265 loops=1)

83. 1.577 7,293.763 ↑ 82.6 6,265 1

Sort (cost=85,339.69..86,634.15 rows=517,785 width=48) (actual time=7,293.431..7,293.763 rows=6,265 loops=1)

  • Sort Key: (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 WHEN (cte1_1.c2 IS NOT NULL) THEN cte1_1.c2 WHEN (cte2.c2 IS NOT NULL) THEN cte2.c2 WHEN (cte3.c2 IS NOT NULL) THEN cte3.c2 ELSE NULL::integer END)
  • Sort Method: quicksort Memory: 793kB
84. 1.766 7,292.186 ↑ 82.6 6,265 1

Merge Full Join (cost=12,281.10..20,268.23 rows=517,785 width=48) (actual time=7,289.457..7,292.186 rows=6,265 loops=1)

  • Merge Cond: (cte3.c2 = (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 WHEN (cte1_1.c2 IS NOT NULL) THEN cte1_1.c2 WHEN (cte2.c2 IS NOT NULL) THEN cte2.c2 ELSE NULL::integer END))
85. 0.567 3,379.146 ↓ 3.1 3,721 1

Sort (cost=86.00..89.02 rows=1,208 width=12) (actual time=3,378.968..3,379.146 rows=3,721 loops=1)

  • Sort Key: cte3.c2
  • Sort Method: quicksort Memory: 271kB
86. 3,378.579 3,378.579 ↓ 3.1 3,721 1

CTE Scan on account_activity_count_cte_email_received_current cte3 (cost=0.00..24.16 rows=1,208 width=12) (actual time=2,742.490..3,378.579 rows=3,721 loops=1)

87. 0.531 3,911.274 ↑ 14.5 5,900 1

Materialize (cost=12,195.10..12,623.73 rows=85,726 width=36) (actual time=3,910.485..3,911.274 rows=5,900 loops=1)

88. 1.178 3,910.743 ↑ 14.5 5,900 1

Sort (cost=12,195.10..12,409.41 rows=85,726 width=36) (actual time=3,910.484..3,910.743 rows=5,900 loops=1)

  • Sort Key: (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 WHEN (cte1_1.c2 IS NOT NULL) THEN cte1_1.c2 WHEN (cte2.c2 IS NOT NULL) THEN cte2.c2 ELSE NULL::integer END)
  • Sort Method: quicksort Memory: 526kB
89. 1.186 3,909.565 ↑ 14.5 5,900 1

Merge Full Join (cost=1,534.02..2,825.95 rows=85,726 width=36) (actual time=3,908.036..3,909.565 rows=5,900 loops=1)

  • Merge Cond: (cte2.c2 = (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 WHEN (cte1_1.c2 IS NOT NULL) THEN cte1_1.c2 ELSE NULL::integer END))
90. 0.804 3,791.331 ↓ 4.8 5,838 1

Sort (cost=86.00..89.02 rows=1,208 width=12) (actual time=3,791.067..3,791.331 rows=5,838 loops=1)

  • Sort Key: cte2.c2
  • Sort Method: quicksort Memory: 466kB
91. 3,790.527 3,790.527 ↓ 4.8 5,838 1

CTE Scan on account_activity_count_cte_email_sent_current cte2 (cost=0.00..24.16 rows=1,208 width=12) (actual time=3,228.258..3,790.527 rows=5,838 loops=1)

92. 0.335 117.048 ↑ 7.6 1,874 1

Sort (cost=1,448.02..1,483.50 rows=14,193 width=24) (actual time=116.965..117.048 rows=1,874 loops=1)

  • Sort Key: (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 WHEN (cte1_1.c2 IS NOT NULL) THEN cte1_1.c2 ELSE NULL::integer END)
  • Sort Method: quicksort Memory: 152kB
93. 0.333 116.713 ↑ 7.6 1,874 1

Merge Full Join (cost=248.01..469.20 rows=14,193 width=24) (actual time=116.279..116.713 rows=1,874 loops=1)

  • Merge Cond: (cte1_1.c2 = (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 ELSE NULL::integer END))
94. 0.077 6.532 ↑ 3.2 519 1

Sort (cost=121.98..126.13 rows=1,660 width=12) (actual time=6.508..6.532 rows=519 loops=1)

  • Sort Key: cte1_1.c2
  • Sort Method: quicksort Memory: 49kB
95. 6.455 6.455 ↑ 3.2 519 1

CTE Scan on account_activity_count_cte_meeting_upcoming cte1_1 (cost=0.00..33.20 rows=1,660 width=12) (actual time=5.087..6.455 rows=519 loops=1)

96. 0.303 109.848 ↓ 1.1 1,861 1

Sort (cost=126.03..130.30 rows=1,710 width=12) (actual time=109.767..109.848 rows=1,861 loops=1)

  • Sort Key: (CASE WHEN (cte0_1.c2 IS NOT NULL) THEN cte0_1.c2 ELSE NULL::integer END)
  • Sort Method: quicksort Memory: 136kB
97. 109.545 109.545 ↓ 1.1 1,861 1

CTE Scan on account_activity_count_cte_meeting_current cte0_1 (cost=0.00..34.20 rows=1,710 width=12) (actual time=91.047..109.545 rows=1,861 loops=1)

98.          

CTE aggregated_domains_cte

99. 0.046 3.493 ↑ 1.2 40 1

GroupAggregate (cost=531.67..532.67 rows=50 width=36) (actual time=3.449..3.493 rows=40 loops=1)

  • Group Key: t2275_accountdomaindistinct.c9105_accountid
100. 0.042 3.447 ↓ 2.8 142 1

Sort (cost=531.67..531.79 rows=50 width=18) (actual time=3.440..3.447 rows=142 loops=1)

  • Sort Key: t2275_accountdomaindistinct.c9105_accountid
  • Sort Method: quicksort Memory: 33kB
101. 1.293 3.405 ↓ 2.8 142 1

Hash Semi Join (cost=1.30..530.26 rows=50 width=18) (actual time=0.034..3.405 rows=142 loops=1)

  • Hash Cond: (t2275_accountdomaindistinct.c9105_accountid = cte0_2.c5)
102. 2.101 2.101 ↑ 1.0 17,757 1

Seq Scan on t2275_accountdomaindistinct (cost=0.00..480.95 rows=18,076 width=18) (actual time=0.011..2.101 rows=17,757 loops=1)

  • Filter: ((NOT deleted) AND (end_stamp = '32503680000000'::bigint))
  • Rows Removed by Filter: 419
103. 0.005 0.011 ↑ 1.0 40 1

Hash (cost=0.80..0.80 rows=40 width=4) (actual time=0.011..0.011 rows=40 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
104. 0.006 0.006 ↑ 1.0 40 1

CTE Scan on account_activity_cte cte0_2 (cost=0.00..0.80 rows=40 width=4) (actual time=0.001..0.006 rows=40 loops=1)

105. 0.020 7,533.783 ↑ 1.0 40 1

Hash Right Join (cost=1.30..2.89 rows=40 width=132) (actual time=7,533.710..7,533.783 rows=40 loops=1)

  • Hash Cond: (cte1.c1 = cte0.c5)
106. 3.510 3.510 ↑ 1.2 40 1

CTE Scan on aggregated_domains_cte cte1 (cost=0.00..1.00 rows=50 width=36) (actual time=3.450..3.510 rows=40 loops=1)

107. 0.016 7,530.253 ↑ 1.0 40 1

Hash (cost=0.80..0.80 rows=40 width=100) (actual time=7,530.253..7,530.253 rows=40 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
108. 7,530.237 7,530.237 ↑ 1.0 40 1

CTE Scan on account_activity_cte cte0 (cost=0.00..0.80 rows=40 width=100) (actual time=7,530.218..7,530.237 rows=40 loops=1)

Planning time : 7.214 ms
Execution time : 7,549.365 ms