explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xIsE

Settings
# exclusive inclusive rows x rows loops node
1. 0.018 52.645 ↑ 2.0 10 1

Limit (cost=10,880.24..10,880.64 rows=20 width=526) (actual time=52.606..52.645 rows=10 loops=1)

2. 0.019 52.627 ↑ 3.7 10 1

Unique (cost=10,880.24..10,880.97 rows=37 width=526) (actual time=52.603..52.627 rows=10 loops=1)

3. 0.037 52.608 ↑ 14.5 10 1

Sort (cost=10,880.24..10,880.61 rows=145 width=526) (actual time=52.601..52.608 rows=10 loops=1)

  • Sort Key: notifications.id DESC, notifications.notified_at_timestamp DESC
  • Sort Method: quicksort Memory: 27kB
4. 0.110 52.571 ↑ 14.5 10 1

Hash Left Join (cost=1,142.03..10,875.04 rows=145 width=526) (actual time=51.727..52.571 rows=10 loops=1)

  • Hash Cond: (notifications.id = connection_notifications.notification_id)
5. 0.292 51.978 ↑ 14.5 10 1

Nested Loop Left Join (cost=1,135.94..1,966.39 rows=145 width=510) (actual time=51.371..51.978 rows=10 loops=1)

  • Join Filter: (custom_workout_followers.id = custom_workout_followers_1.id)
  • Rows Removed by Join Filter: 150
6. 0.030 50.956 ↑ 14.5 10 1

Hash Left Join (cost=1,135.51..1,851.83 rows=145 width=506) (actual time=50.723..50.956 rows=10 loops=1)

  • Hash Cond: (notifications.id = comment_mention_notifications.notification_id)
7. 0.036 50.462 ↑ 14.5 10 1

Nested Loop Left Join (cost=1,127.60..1,843.36 rows=145 width=474) (actual time=50.241..50.462 rows=10 loops=1)

8. 0.088 50.386 ↑ 14.5 10 1

Hash Left Join (cost=1,126.60..1,285.27 rows=145 width=462) (actual time=50.223..50.386 rows=10 loops=1)

  • Hash Cond: (custom_workout_notifications.custom_workout_id = custom_workouts.id)
9. 0.023 13.501 ↑ 14.5 10 1

Hash Left Join (cost=420.13..576.81 rows=145 width=432) (actual time=13.357..13.501 rows=10 loops=1)

  • Hash Cond: (notifications.id = custom_workout_follower_notifications.notification_id)
10. 0.026 13.266 ↑ 14.5 10 1

Hash Left Join (cost=304.62..460.74 rows=145 width=378) (actual time=13.139..13.266 rows=10 loops=1)

  • Hash Cond: (notifications.id = custom_workout_notifications.notification_id)
11. 0.027 13.228 ↑ 14.5 10 1

Hash Left Join (cost=303.51..459.08 rows=145 width=362) (actual time=13.118..13.228 rows=10 loops=1)

  • Hash Cond: (feed_activity_comments.comment_id = comments.id)
12. 0.027 12.897 ↑ 14.5 10 1

Hash Left Join (cost=296.32..449.90 rows=145 width=362) (actual time=12.806..12.897 rows=10 loops=1)

  • Hash Cond: (notifications.id = comment_reaction_notifications.notification_id)
13. 0.023 12.604 ↑ 14.5 10 1

Hash Left Join (cost=286.02..439.05 rows=145 width=326) (actual time=12.532..12.604 rows=10 loops=1)

  • Hash Cond: (feed_activity_comment_notifications.feed_activity_comment_id = feed_activity_comments.id)
14. 0.029 12.276 ↑ 14.5 10 1

Hash Left Join (cost=279.84..430.87 rows=145 width=310) (actual time=12.220..12.276 rows=10 loops=1)

  • Hash Cond: (notifications.id = feed_activity_comment_notifications.notification_id)
15. 0.030 12.127 ↑ 14.5 10 1

Hash Left Join (cost=277.20..427.62 rows=145 width=294) (actual time=12.091..12.127 rows=10 loops=1)

  • Hash Cond: (notifications.id = feed_activity_reaction_notifications.notification_id)
16. 5.422 10.953 ↑ 14.5 10 1

Hash Right Join (cost=255.42..405.23 rows=145 width=266) (actual time=10.934..10.953 rows=10 loops=1)

  • Hash Cond: (feed_activity_notifications.notification_id = notifications.id)
17. 5.296 5.296 ↑ 1.0 6,953 1

Seq Scan on feed_activity_notifications (cost=0.00..120.99 rows=7,299 width=24) (actual time=0.007..5.296 rows=6,953 loops=1)

18. 0.014 0.235 ↑ 3.7 10 1

Hash (cost=254.96..254.96 rows=37 width=250) (actual time=0.235..0.235 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
19. 0.037 0.221 ↑ 3.7 10 1

Nested Loop Left Join (cost=5.77..254.96 rows=37 width=250) (actual time=0.054..0.221 rows=10 loops=1)

20. 0.120 0.144 ↑ 3.7 10 1

Bitmap Heap Scan on notifications (cost=5.49..47.49 rows=37 width=109) (actual time=0.042..0.144 rows=10 loops=1)

  • Recheck Cond: (sent_to_account_id = 5607)
  • Filter: ((created_at <= '2019-04-12 09:22:25'::timestamp without time zone) AND (device_type = ANY ('{all,android}'::notification_device_type[])) AND (notification_type <> ALL ('{connection_achievement_multiple,connection_achievement,connection_external_workout_multiple,connection_external_workout,connection_seven_workout_multiple,connection_seven_workout}'::notification_type[])))
  • Rows Removed by Filter: 150
  • Heap Blocks: exact=22
21. 0.024 0.024 ↓ 1.0 161 1

Bitmap Index Scan on index_notifications_sent_to_account_id (cost=0.00..5.48 rows=160 width=0) (actual time=0.024..0.024 rows=161 loops=1)

  • Index Cond: (sent_to_account_id = 5607)
22. 0.040 0.040 ↑ 1.0 1 10

Index Scan using index_user_info_account_id on user_info (cost=0.28..5.60 rows=1 width=141) (actual time=0.003..0.004 rows=1 loops=10)

  • Index Cond: (account_id = notifications.publisher_account_id)
23. 0.080 1.144 ↓ 1.1 94 1

Hash (cost=20.69..20.69 rows=87 width=36) (actual time=1.144..1.144 rows=94 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
24. 0.215 1.064 ↓ 1.1 94 1

Hash Right Join (cost=16.23..20.69 rows=87 width=36) (actual time=0.719..1.064 rows=94 loops=1)

  • Hash Cond: (fa_reactions.id = feed_activity_reactions.reaction_id)
25. 0.147 0.147 ↓ 1.1 176 1

Seq Scan on reactions fa_reactions (cost=0.00..3.60 rows=160 width=12) (actual time=0.007..0.147 rows=176 loops=1)

26. 0.078 0.702 ↓ 1.1 94 1

Hash (cost=15.14..15.14 rows=87 width=40) (actual time=0.702..0.702 rows=94 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
27. 0.354 0.624 ↓ 1.1 94 1

Hash Right Join (cost=2.96..15.14 rows=87 width=40) (actual time=0.167..0.624 rows=94 loops=1)

  • Hash Cond: (feed_activity_reactions.id = feed_activity_reaction_notifications.feed_activity_reaction_id)
28. 0.120 0.120 ↑ 3.7 145 1

Seq Scan on feed_activity_reactions (cost=0.00..9.32 rows=532 width=24) (actual time=0.006..0.120 rows=145 loops=1)

29. 0.083 0.150 ↓ 1.1 94 1

Hash (cost=1.87..1.87 rows=87 width=24) (actual time=0.150..0.150 rows=94 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
30. 0.067 0.067 ↓ 1.1 94 1

Seq Scan on feed_activity_reaction_notifications (cost=0.00..1.87 rows=87 width=24) (actual time=0.006..0.067 rows=94 loops=1)

31. 0.063 0.120 ↓ 1.0 75 1

Hash (cost=1.73..1.73 rows=73 width=24) (actual time=0.120..0.120 rows=75 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
32. 0.057 0.057 ↓ 1.0 75 1

Seq Scan on feed_activity_comment_notifications (cost=0.00..1.73 rows=73 width=24) (actual time=0.004..0.057 rows=75 loops=1)

33. 0.152 0.305 ↓ 1.0 189 1

Hash (cost=3.86..3.86 rows=186 width=24) (actual time=0.305..0.305 rows=189 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
34. 0.153 0.153 ↓ 1.0 189 1

Seq Scan on feed_activity_comments (cost=0.00..3.86 rows=186 width=24) (actual time=0.007..0.153 rows=189 loops=1)

35. 0.009 0.266 ↓ 2.2 9 1

Hash (cost=10.25..10.25 rows=4 width=44) (actual time=0.266..0.266 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.029 0.257 ↓ 2.2 9 1

Nested Loop Left Join (cost=1.53..10.25 rows=4 width=44) (actual time=0.073..0.257 rows=9 loops=1)

37. 0.032 0.201 ↓ 2.2 9 1

Nested Loop Left Join (cost=1.38..9.21 rows=4 width=36) (actual time=0.066..0.201 rows=9 loops=1)

38. 0.026 0.142 ↓ 2.2 9 1

Nested Loop Left Join (cost=1.24..5.56 rows=4 width=36) (actual time=0.057..0.142 rows=9 loops=1)

39. 0.044 0.089 ↓ 2.2 9 1

Hash Right Join (cost=1.09..2.50 rows=4 width=40) (actual time=0.048..0.089 rows=9 loops=1)

  • Hash Cond: (comment_reactions.id = comment_reaction_notifications.comment_reaction_id)
40. 0.026 0.026 ↓ 1.1 31 1

Seq Scan on comment_reactions (cost=0.00..1.27 rows=27 width=24) (actual time=0.004..0.026 rows=31 loops=1)

41. 0.006 0.019 ↓ 2.2 9 1

Hash (cost=1.04..1.04 rows=4 width=24) (actual time=0.019..0.019 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
42. 0.013 0.013 ↓ 2.2 9 1

Seq Scan on comment_reaction_notifications (cost=0.00..1.04 rows=4 width=24) (actual time=0.004..0.013 rows=9 loops=1)

43. 0.027 0.027 ↑ 1.0 1 9

Index Scan using reactions_pkey on reactions c_reactions (cost=0.14..0.76 rows=1 width=12) (actual time=0.002..0.003 rows=1 loops=9)

  • Index Cond: (id = comment_reactions.reaction_id)
44. 0.027 0.027 ↑ 1.0 1 9

Index Only Scan using comments_pkey on comments comment_reaction_comments (cost=0.14..0.90 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=9)

  • Index Cond: (id = comment_reactions.comment_id)
  • Heap Fetches: 9
45. 0.027 0.027 ↑ 1.0 1 9

Index Scan using index_feed_activity_comments_comment_id on feed_activity_comments comment_reaction_activity_comments (cost=0.14..0.25 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=9)

  • Index Cond: (comment_id = comment_reaction_comments.id)
46. 0.147 0.304 ↓ 1.0 189 1

Hash (cost=4.86..4.86 rows=186 width=8) (actual time=0.304..0.304 rows=189 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
47. 0.157 0.157 ↓ 1.0 189 1

Seq Scan on comments (cost=0.00..4.86 rows=186 width=8) (actual time=0.005..0.157 rows=189 loops=1)

48. 0.006 0.012 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=24) (actual time=0.012..0.012 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
49. 0.006 0.006 ↑ 1.0 5 1

Seq Scan on custom_workout_notifications (cost=0.00..1.05 rows=5 width=24) (actual time=0.002..0.006 rows=5 loops=1)

50. 0.015 0.212 ↓ 1.1 16 1

Hash (cost=115.34..115.34 rows=14 width=62) (actual time=0.212..0.212 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
51. 0.051 0.197 ↓ 1.1 16 1

Nested Loop Left Join (cost=1.60..115.34 rows=14 width=62) (actual time=0.049..0.197 rows=16 loops=1)

52. 0.036 0.082 ↓ 1.1 16 1

Hash Right Join (cost=1.32..2.66 rows=14 width=32) (actual time=0.040..0.082 rows=16 loops=1)

  • Hash Cond: (custom_workout_followers.id = custom_workout_follower_notifications.custom_workout_follower_id)
53. 0.017 0.017 ↓ 1.1 17 1

Seq Scan on custom_workout_followers (cost=0.00..1.15 rows=15 width=16) (actual time=0.003..0.017 rows=17 loops=1)

54. 0.017 0.029 ↓ 1.1 16 1

Hash (cost=1.14..1.14 rows=14 width=24) (actual time=0.029..0.029 rows=16 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
55. 0.012 0.012 ↓ 1.1 16 1

Seq Scan on custom_workout_follower_notifications (cost=0.00..1.14 rows=14 width=24) (actual time=0.003..0.012 rows=16 loops=1)

56. 0.064 0.064 ↑ 1.0 1 16

Index Scan using custom_workouts_pkey on custom_workouts cw_follower_custom_workouts (cost=0.29..8.04 rows=1 width=38) (actual time=0.003..0.004 rows=1 loops=16)

  • Index Cond: (id = custom_workout_followers.custom_workout_id)
57. 18.831 36.797 ↑ 1.0 20,243 1

Hash (cost=453.43..453.43 rows=20,243 width=38) (actual time=36.797..36.797 rows=20,243 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1655kB
58. 17.966 17.966 ↑ 1.0 20,243 1

Seq Scan on custom_workouts (cost=0.00..453.43 rows=20,243 width=38) (actual time=0.005..17.966 rows=20,243 loops=1)

59. 0.010 0.040 ↓ 0.0 0 10

Nested Loop (cost=1.00..3.84 rows=1 width=20) (actual time=0.004..0.004 rows=0 loops=10)

60. 0.020 0.030 ↓ 0.0 0 10

Nested Loop (cost=0.57..0.72 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=10)

61. 0.010 0.010 ↓ 0.0 0 10

Index Only Scan using custom_workouts_pkey on custom_workouts cw (cost=0.29..0.37 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (id = custom_workouts.id)
  • Heap Fetches: 0
62. 0.000 0.000 ↓ 0.0 0

Index Scan using index_custom_workout_activities_custom_workout_id on custom_workout_activities (cost=0.29..0.34 rows=1 width=16) (never executed)

  • Index Cond: (custom_workout_id = cw.id)
63. 0.000 0.000 ↓ 0.0 0

Index Scan using activities_pkey on activities (cost=0.42..3.11 rows=1 width=20) (never executed)

  • Index Cond: (id = custom_workout_activities.activity_id)
  • Filter: (activity_type = 'custom_workout'::activity_type)
64. 0.016 0.464 ↑ 1.1 14 1

Hash (cost=7.73..7.73 rows=15 width=40) (actual time=0.464..0.464 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
65. 0.190 0.448 ↑ 1.1 14 1

Hash Right Join (cost=3.02..7.73 rows=15 width=40) (actual time=0.156..0.448 rows=14 loops=1)

  • Hash Cond: (comment_mentions_feed_activity_comments.comment_id = comment_mentions.comment_id)
66. 0.143 0.143 ↓ 1.0 189 1

Seq Scan on feed_activity_comments comment_mentions_feed_activity_comments (cost=0.00..3.86 rows=186 width=16) (actual time=0.008..0.143 rows=189 loops=1)

67. 0.014 0.115 ↑ 1.1 14 1

Hash (cost=2.83..2.83 rows=15 width=32) (actual time=0.115..0.115 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
68. 0.049 0.101 ↑ 1.1 14 1

Hash Right Join (cost=1.34..2.83 rows=15 width=32) (actual time=0.048..0.101 rows=14 loops=1)

  • Hash Cond: (comment_mentions.id = comment_mention_notifications.comment_mention_id)
69. 0.022 0.022 ↑ 1.0 25 1

Seq Scan on comment_mentions (cost=0.00..1.25 rows=25 width=16) (actual time=0.005..0.022 rows=25 loops=1)

70. 0.015 0.030 ↑ 1.1 14 1

Hash (cost=1.15..1.15 rows=15 width=24) (actual time=0.030..0.030 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
71. 0.015 0.015 ↑ 1.1 14 1

Seq Scan on comment_mention_notifications (cost=0.00..1.15 rows=15 width=24) (actual time=0.004..0.015 rows=14 loops=1)

72. 0.126 0.730 ↓ 15.0 15 10

Materialize (cost=0.42..112.39 rows=1 width=20) (actual time=0.005..0.073 rows=15 loops=10)

73. 0.245 0.604 ↓ 15.0 15 1

Nested Loop (cost=0.42..112.38 rows=1 width=20) (actual time=0.039..0.604 rows=15 loops=1)

  • Join Filter: (custom_workout_follower_activities.custom_workout_follower_id = custom_workout_followers_1.id)
  • Rows Removed by Join Filter: 240
74. 0.046 0.149 ↓ 15.0 15 1

Nested Loop (cost=0.42..111.04 rows=1 width=20) (actual time=0.026..0.149 rows=15 loops=1)

75. 0.013 0.013 ↓ 1.2 15 1

Seq Scan on custom_workout_follower_activities (cost=0.00..1.13 rows=13 width=16) (actual time=0.003..0.013 rows=15 loops=1)

76. 0.090 0.090 ↑ 1.0 1 15

Index Scan using activities_pkey on activities activities_1 (cost=0.42..8.45 rows=1 width=20) (actual time=0.005..0.006 rows=1 loops=15)

  • Index Cond: (id = custom_workout_follower_activities.activity_id)
  • Filter: (activity_type = 'custom_workout_new_follower'::activity_type)
77. 0.210 0.210 ↓ 1.1 17 15

Seq Scan on custom_workout_followers custom_workout_followers_1 (cost=0.00..1.15 rows=15 width=8) (actual time=0.001..0.014 rows=17 loops=15)

78. 0.145 0.293 ↑ 1.0 177 1

Hash (cost=3.82..3.82 rows=182 width=24) (actual time=0.293..0.293 rows=177 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
79. 0.148 0.148 ↑ 1.0 177 1

Seq Scan on connection_notifications (cost=0.00..3.82 rows=182 width=24) (actual time=0.007..0.148 rows=177 loops=1)

80.          

SubPlan (forHash Left Join)

81. 0.020 0.060 ↑ 1.0 1 10

Aggregate (cost=19.17..19.18 rows=1 width=0) (actual time=0.006..0.006 rows=1 loops=10)

82. 0.040 0.040 ↓ 0.0 0 10

Index Only Scan using index_feed_activity_notifications_notification_id on feed_activity_notifications feed_activity_notifications_1 (cost=0.28..19.16 rows=5 width=0) (actual time=0.004..0.004 rows=0 loops=10)

  • Index Cond: (notification_id = notifications.id)
  • Heap Fetches: 0
83. 0.020 0.030 ↓ 0.0 0 10

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=10)

84. 0.010 0.010 ↓ 0.0 0 10

Index Scan using index_activities_feed_activity_id on activities activities_2 (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (feed_activity_id = feed_activity_notifications.feed_activity_id)
85. 0.020 0.030 ↓ 0.0 0 10

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=10)

86. 0.010 0.010 ↓ 0.0 0 10

Index Scan using index_activities_feed_activity_id on activities activities_3 (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (feed_activity_id = feed_activity_reactions.feed_activity_id)
87. 0.010 0.020 ↓ 0.0 0 10

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=10)

88. 0.010 0.010 ↓ 0.0 0 10

Index Scan using index_activities_feed_activity_id on activities activities_4 (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (feed_activity_id = feed_activity_comments.feed_activity_id)
89. 0.010 0.020 ↓ 0.0 0 10

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=10)

90. 0.010 0.010 ↓ 0.0 0 10

Index Scan using index_activities_feed_activity_id on activities activities_5 (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (feed_activity_id = comment_reaction_activity_comments.feed_activity_id)
91. 0.020 0.030 ↓ 0.0 0 10

Limit (cost=0.42..8.44 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=10)

92. 0.010 0.010 ↓ 0.0 0 10

Index Scan using index_activities_feed_activity_id on activities activities_6 (cost=0.42..8.44 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=10)

  • Index Cond: (feed_activity_id = comment_mentions_feed_activity_comments.feed_activity_id)
Planning time : 16.868 ms
Execution time : 53.659 ms