explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rb8Bm

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 3,588.667 ↑ 1.0 40 1

Limit (cost=167,292,128.21..167,298,399.68 rows=40 width=76) (actual time=3,588.052..3,588.667 rows=40 loops=1)

  • Buffers: shared hit=233,262, temp read=931 written=954
2.          

CTE filtered_accounts_cte

3. 14.660 183.612 ↑ 1.5 35,856 1

Hash Join (cost=73,196.49..1,568,434.48 rows=55,530 width=40) (actual time=153.465..183.612 rows=35,856 loops=1)

  • Hash Cond: (t1401_accountfact.sid = t2268_accountdim.sid)
  • Buffers: shared hit=54,567, temp read=190 written=188
4. 15.909 27.627 ↑ 1.1 35,856 1

Bitmap Heap Scan on t1401_accountfact (cost=13,897.51..1,503,241.29 rows=38,721 width=4) (actual time=11.844..27.627 rows=35,856 loops=1)

  • Recheck Cond: ((end_stamp > '1593172558000'::bigint) AND (start_stamp <= '1593172558000'::bigint))
  • Filter: ((NOT deleted) AND ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (alternatives: SubPlan 3 or hashed SubPlan 4)))
  • Rows Removed by Filter: 23,736
  • Heap Blocks: exact=1,137
  • Buffers: shared hit=3,558
5. 11.351 11.351 ↑ 1.0 59,616 1

Bitmap Index Scan on idx_933_t1401_accountfact_sid_end_stamp_start_stamp_null (cost=0.00..13,887.83 rows=61,341 width=0) (actual time=11.351..11.351 rows=59,616 loops=1)

  • Index Cond: ((end_stamp > '1593172558000'::bigint) AND (start_stamp <= '1593172558000'::bigint))
  • Buffers: shared hit=2,318
6.          

SubPlan (for Bitmap Heap Scan)

7. 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)
8. 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))
9. 0.000 0.000 ↓ 0.0 0

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

10. 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 = t1401_accountfact.c7136_ownerid) AND (c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
11. 0.102 0.300 ↓ 1.5 359 1

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

  • Hash Cond: (t786_userrolehierarchy_1.c4812_user_role_id = t859_userroledim_1.sid)
  • Buffers: shared hit=76
12. 0.115 0.149 ↑ 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.047..0.149 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
  • Buffers: shared hit=70
13. 0.034 0.034 ↑ 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.034..0.034 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Buffers: shared hit=8
14. 0.010 0.049 ↓ 1.5 44 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=6
15. 0.039 0.039 ↓ 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.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
  • Buffers: shared hit=6
16. 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 = t1401_accountfact.c7136_ownerid) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (c4570_userroleid IS NULL) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
17. 0.039 0.067 ↑ 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.038..0.067 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
  • Buffers: shared hit=27
18. 0.028 0.028 ↑ 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.028..0.028 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Buffers: shared hit=4
19. 10.023 141.325 ↑ 2.1 35,941 1

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

  • Buckets: 65,536 Batches: 2 Memory Usage: 1,801kB
  • Buffers: shared hit=51,009, temp written=134
20. 131.302 131.302 ↑ 2.1 35,941 1

Seq Scan on t2268_accountdim (cost=0.00..57,786.71 rows=74,422 width=40) (actual time=0.004..131.302 rows=35,941 loops=1)

  • Filter: ((NOT deleted) AND (start_stamp <= '1593172558000'::bigint) AND (end_stamp > '1593172558000'::bigint))
  • Rows Removed by Filter: 438,189
  • Buffers: shared hit=51,009
21.          

CTE account_activity_count_cte_meeting_current

22. 4.469 103.707 ↓ 1.1 1,861 1

Unique (cost=1,731,261.89..1,731,527.63 rows=1,710 width=4) (actual time=93.121..103.707 rows=1,861 loops=1)

  • Buffers: shared hit=5,110, temp read=117 written=118
23. 40.055 99.238 ↓ 1.3 67,811 1

Sort (cost=1,731,261.89..1,731,394.76 rows=53,149 width=4) (actual time=93.119..99.238 rows=67,811 loops=1)

  • Sort Key: t2273_meetingactivityaccountfact.c9010_accountid
  • Sort Method: external merge Disk: 936kB
  • Buffers: shared hit=5,110, temp read=117 written=118
24. 58.922 59.183 ↓ 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=4) (actual time=0.288..59.183 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 6 or hashed SubPlan 7) OR (alternatives: SubPlan 8 or hashed SubPlan 9))
  • Rows Removed by Filter: 6,979
  • Buffers: shared hit=5,110
25.          

SubPlan (for Index Scan)

26. 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)
27. 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))
28. 0.000 0.000 ↓ 0.0 0

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

29. 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.c9004_activityownersfuserid) AND (c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
30. 0.078 0.209 ↓ 1.5 359 1

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

  • Hash Cond: (t786_userrolehierarchy_3.c4812_user_role_id = t859_userroledim_3.sid)
  • Buffers: shared hit=76
31. 0.074 0.097 ↑ 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.032..0.097 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
  • Buffers: shared hit=70
32. 0.023 0.023 ↑ 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.023..0.023 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Buffers: shared hit=8
33. 0.007 0.034 ↓ 1.5 44 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=6
34. 0.027 0.027 ↓ 1.5 44 1

Seq Scan on t859_userroledim t859_userroledim_3 (cost=0.00..7.35 rows=29 width=4) (actual time=0.002..0.027 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
  • Buffers: shared hit=6
35. 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.c9004_activityownersfuserid) AND (end_stamp = '32503680000000'::bigint))
  • Filter: ((NOT deleted) AND (c4570_userroleid IS NULL) AND (sid <> '-2'::integer) AND (c4581_usertype = 'Standard'::text))
36. 0.038 0.052 ↑ 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.023..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
  • Buffers: shared hit=27
37. 0.014 0.014 ↑ 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.014..0.014 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Buffers: shared hit=4
38. 0.422 3,588.661 ↑ 138.8 40 1

GroupAggregate (cost=163,992,166.09..164,862,803.54 rows=5,553 width=76) (actual time=3,588.051..3,588.661 rows=40 loops=1)

  • Group Key: cte0.c3, cte0.c1
  • Buffers: shared hit=233,262, temp read=931 written=954
39. 196.923 3,588.239 ↑ 50,556.4 1,722 1

Sort (cost=163,992,166.09..164,209,811.57 rows=87,058,192 width=40) (actual time=3,588.032..3,588.239 rows=1,722 loops=1)

  • Sort Key: cte0.c3, cte0.c1
  • Sort Method: external merge Disk: 3,344kB
  • Buffers: shared hit=233,262, temp read=931 written=954
40. 19.249 3,391.316 ↑ 843.7 103,187 1

Merge Join (cost=144,058,773.16..145,369,658.01 rows=87,058,192 width=40) (actual time=3,344.593..3,391.316 rows=103,187 loops=1)

  • Merge Cond: (cte0.c1 = t2608_emailactivityaccountfact_copy_sentha.c9638_accountid)
  • Buffers: shared hit=233,262, temp read=535 written=535
41. 15.252 211.598 ↑ 1.5 35,851 1

Sort (cost=5,486.64..5,625.46 rows=55,530 width=36) (actual time=207.011..211.598 rows=35,851 loops=1)

  • Sort Key: cte0.c1
  • Sort Method: quicksort Memory: 3,464kB
  • Buffers: shared hit=54,567, temp read=190 written=188
42. 196.346 196.346 ↑ 1.5 35,856 1

CTE Scan on filtered_accounts_cte cte0 (cost=0.00..1,110.60 rows=55,530 width=36) (actual time=153.467..196.346 rows=35,856 loops=1)

  • Buffers: shared hit=54,567, temp read=190 written=188
43. 12.125 3,160.469 ↑ 18.3 103,217 1

Materialize (cost=144,053,286.53..144,062,755.85 rows=1,893,864 width=8) (actual time=3,137.576..3,160.469 rows=103,217 loops=1)

  • Buffers: shared hit=178,695, temp read=345 written=347
44. 59.709 3,148.344 ↑ 18.3 103,217 1

Sort (cost=144,053,286.53..144,058,021.19 rows=1,893,864 width=8) (actual time=3,137.573..3,148.344 rows=103,217 loops=1)

  • Sort Key: t2608_emailactivityaccountfact_copy_sentha.c9638_accountid
  • Sort Method: external merge Disk: 1,824kB
  • Buffers: shared hit=178,695, temp read=345 written=347
45. 248.688 3,088.635 ↑ 18.3 103,217 1

Hash Anti Join (cost=56.14..143,829,930.73 rows=1,893,864 width=8) (actual time=104.665..3,088.635 rows=103,217 loops=1)

  • Hash Cond: (t2608_emailactivityaccountfact_copy_sentha.c9638_accountid = account_activity_count_cte_meeting_current.c1)
  • Buffers: shared hit=178,695, temp read=117 written=118
46. 2,735.337 2,735.700 ↑ 1.9 2,047,385 1

Index Scan using idx_isinternal_sentha1 on t2608_emailactivityaccountfact_copy_sentha (cost=0.56..143,590,538.08 rows=3,787,729 width=8) (actual time=0.404..2,735.700 rows=2,047,385 loops=1)

  • Index Cond: ((c9660_isinternalinitiated = true) AND (end_stamp > '1593172558000'::bigint) AND (start_stamp <= '1593172558000'::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,649
  • Buffers: shared hit=173,585
47.          

SubPlan (for Index Scan)

48. 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)
49. 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))
50. 0.000 0.000 ↓ 0.0 0

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

51. 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))
52. 0.103 0.303 ↓ 1.5 359 1

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

  • Hash Cond: (t786_userrolehierarchy_5.c4812_user_role_id = t859_userroledim_5.sid)
  • Buffers: shared hit=76
53. 0.118 0.155 ↑ 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.051..0.155 rows=359 loops=1)

  • Recheck Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Heap Blocks: exact=62
  • Buffers: shared hit=70
54. 0.037 0.037 ↑ 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.037..0.037 rows=359 loops=1)

  • Index Cond: ((c4815_ancestor_role_id = 12) AND (end_stamp = '32503680000000'::bigint))
  • Buffers: shared hit=8
55. 0.007 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
  • Buffers: shared hit=6
56. 0.038 0.038 ↓ 1.5 44 1

Seq Scan on t859_userroledim t859_userroledim_5 (cost=0.00..7.35 rows=29 width=4) (actual time=0.005..0.038 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
  • Buffers: shared hit=6
57. 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))
58. 0.042 0.060 ↑ 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.031..0.060 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
  • Buffers: shared hit=27
59. 0.018 0.018 ↑ 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.018..0.018 rows=36 loops=1)

  • Index Cond: ((c4570_userroleid IS NULL) AND (end_stamp = '32503680000000'::bigint))
  • Buffers: shared hit=4
60. 0.230 104.247 ↓ 1.1 1,861 1

Hash (cost=34.20..34.20 rows=1,710 width=4) (actual time=104.247..104.247 rows=1,861 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 82kB
  • Buffers: shared hit=5,110, temp read=117 written=118
61. 104.017 104.017 ↓ 1.1 1,861 1

CTE Scan on account_activity_count_cte_meeting_current (cost=0.00..34.20 rows=1,710 width=4) (actual time=93.123..104.017 rows=1,861 loops=1)

  • Buffers: shared hit=5,110, temp read=117 written=118
Planning time : 4.661 ms
Execution time : 3,591.912 ms