explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B4k4 : contributions calendar

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.091 ↓ 0.0 0 1

Append (cost=1,316.49..1,546.21 rows=8 width=50) (actual time=0.091..0.091 rows=0 loops=1)

  • Buffers: shared hit=10
2.          

CTE user_events_in_range

3. 0.043 0.043 ↓ 0.0 0 1

Index Scan using index_events_on_author_id_and_created_at on public.events events_7 (cost=0.57..1,250.61 rows=675 width=27) (actual time=0.043..0.043 rows=0 loops=1)

  • Index Cond: ((events_7.author_id = 86) AND (events_7.created_at >= '2019-09-04 00:00:00+00'::timestamp with time zone) AND (events_7.created_at <= '2020-09-04 23:59:59.999999+00'::timestamp with time zone))
  • Filter: ((events_7.action = 5) OR ((events_7.action = 1) AND ((events_7.target_type)::text = ANY ('{MergeRequest,Issue,DesignManagement::Design,WikiPage::Meta}'::text[]))) OR ((events_7.action = 3) AND ((events_7.target_type)::text = ANY ('{MergeRequest,Issue}'::text[]))) OR ((events_7.action = 7) AND ((events_7.target_type)::text = 'MergeRequest'::text)) OR ((events_7.action = 2) AND ((events_7.target_type)::text = ANY ('{DesignManagement::Design,WikiPage::Meta}'::text[]))) OR ((events_7.action = 6) AND ((events_7.target_type)::text = 'Note'::text)))
  • Rows Removed by Filter: 6
  • Buffers: shared hit=10
4. 0.001 0.060 ↓ 0.0 0 1

Aggregate (cost=65.88..65.93 rows=2 width=50) (actual time=0.060..0.060 rows=0 loops=1)

  • Group Key: events.project_id, events.target_type, events.action, events.date
  • Buffers: shared hit=10
5. 0.013 0.059 ↓ 0.0 0 1

Sort (cost=65.88..65.89 rows=2 width=46) (actual time=0.058..0.059 rows=0 loops=1)

  • Sort Key: events.project_id, events.target_type, events.date
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
6. 0.001 0.046 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..65.87 rows=2 width=46) (actual time=0.045..0.046 rows=0 loops=1)

  • Buffers: shared hit=10
7. 0.045 0.045 ↓ 0.0 0 1

CTE Scan on user_events_in_range events (cost=0.00..15.19 rows=3 width=46) (actual time=0.045..0.045 rows=0 loops=1)

  • Filter: (events.action = 5)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=10
8. 0.000 0.000 ↓ 0.0 0 0

Materialize (cost=0.87..50.30 rows=9 width=4) (actual time=0.000..0.000 rows=0 loops=0)

9. 0.000 0.000 ↓ 0.0 0 0

Nested Loop Left Join (cost=0.87..50.26 rows=9 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((project_features.repository_access_level > 0) OR (project_features.repository_access_level IS NULL))
  • Rows Removed by Filter: 0
10. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using projects_pkey on public.projects (cost=0.43..19.07 rows=9 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects.id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[]))
  • Heap Fetches: 0
11. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_project_features_on_project_id on public.project_features (cost=0.43..3.45 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects.id = project_features.project_id)
12. 0.000 0.005 ↓ 0.0 0 1

Aggregate (cost=39.37..39.40 rows=1 width=50) (actual time=0.005..0.005 rows=0 loops=1)

  • Group Key: events_1.project_id, events_1.target_type, events_1.action, events_1.date
13. 0.004 0.005 ↓ 0.0 0 1

Sort (cost=39.37..39.38 rows=1 width=46) (actual time=0.005..0.005 rows=0 loops=1)

  • Sort Key: events_1.project_id, events_1.action, events_1.date
  • Sort Method: quicksort Memory: 25kB
14. 0.001 0.001 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..39.36 rows=1 width=46) (actual time=0.001..0.001 rows=0 loops=1)

15. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on user_events_in_range events_1 (cost=0.00..16.88 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((events_1.action = ANY ('{1,3}'::integer[])) AND ((events_1.target_type)::text = 'Issue'::text))
  • Rows Removed by Filter: 0
16. 0.000 0.000 ↓ 0.0 0 0

Nested Loop Left Join (cost=0.87..22.48 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((project_features_1.issues_access_level > 0) OR (project_features_1.issues_access_level IS NULL))
  • Rows Removed by Filter: 0
17. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using projects_pkey on public.projects projects_1 (cost=0.43..19.02 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((projects_1.id = events_1.project_id) AND (projects_1.id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[])))
  • Heap Fetches: 0
18. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_project_features_on_project_id on public.project_features project_features_1 (cost=0.43..3.45 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects_1.id = project_features_1.project_id)
19. 0.000 0.004 ↓ 0.0 0 1

Aggregate (cost=39.37..39.40 rows=1 width=50) (actual time=0.004..0.004 rows=0 loops=1)

  • Group Key: events_2.project_id, events_2.target_type, events_2.action, events_2.date
20. 0.003 0.004 ↓ 0.0 0 1

Sort (cost=39.37..39.38 rows=1 width=46) (actual time=0.004..0.004 rows=0 loops=1)

  • Sort Key: events_2.project_id, events_2.action, events_2.date
  • Sort Method: quicksort Memory: 25kB
21. 0.001 0.001 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..39.36 rows=1 width=46) (actual time=0.000..0.001 rows=0 loops=1)

22. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on user_events_in_range events_2 (cost=0.00..16.88 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((events_2.action = ANY ('{1,2}'::integer[])) AND ((events_2.target_type)::text = 'WikiPage::Meta'::text))
  • Rows Removed by Filter: 0
23. 0.000 0.000 ↓ 0.0 0 0

Nested Loop Left Join (cost=0.87..22.48 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((project_features_2.wiki_access_level > 0) OR (project_features_2.wiki_access_level IS NULL))
  • Rows Removed by Filter: 0
24. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using projects_pkey on public.projects projects_2 (cost=0.43..19.02 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((projects_2.id = events_2.project_id) AND (projects_2.id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[])))
  • Heap Fetches: 0
25. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_project_features_on_project_id on public.project_features project_features_2 (cost=0.43..3.45 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects_2.id = project_features_2.project_id)
26. 0.000 0.004 ↓ 0.0 0 1

Aggregate (cost=40.22..40.25 rows=1 width=50) (actual time=0.004..0.004 rows=0 loops=1)

  • Group Key: events_3.project_id, events_3.target_type, events_3.action, events_3.date
27. 0.003 0.004 ↓ 0.0 0 1

Sort (cost=40.22..40.22 rows=1 width=46) (actual time=0.004..0.004 rows=0 loops=1)

  • Sort Key: events_3.project_id, events_3.action, events_3.date
  • Sort Method: quicksort Memory: 25kB
28. 0.001 0.001 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..40.21 rows=1 width=46) (actual time=0.001..0.001 rows=0 loops=1)

29. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on user_events_in_range events_3 (cost=0.00..17.72 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (((events_3.target_type)::text = 'MergeRequest'::text) AND (events_3.action = ANY ('{7,1,3}'::integer[])))
  • Rows Removed by Filter: 0
30. 0.000 0.000 ↓ 0.0 0 0

Nested Loop Left Join (cost=0.87..22.48 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((project_features_3.merge_requests_access_level > 0) OR (project_features_3.merge_requests_access_level IS NULL))
  • Rows Removed by Filter: 0
31. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using projects_pkey on public.projects projects_3 (cost=0.43..19.02 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((projects_3.id = events_3.project_id) AND (projects_3.id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[])))
  • Heap Fetches: 0
32. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_project_features_on_project_id on public.project_features project_features_3 (cost=0.43..3.45 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects_3.id = project_features_3.project_id)
33. 0.000 0.004 ↓ 0.0 0 1

Aggregate (cost=39.37..39.40 rows=1 width=50) (actual time=0.004..0.004 rows=0 loops=1)

  • Group Key: events_4.project_id, events_4.target_type, events_4.action, events_4.date
34. 0.003 0.004 ↓ 0.0 0 1

Sort (cost=39.37..39.38 rows=1 width=46) (actual time=0.004..0.004 rows=0 loops=1)

  • Sort Key: events_4.project_id, events_4.action, events_4.date
  • Sort Method: quicksort Memory: 25kB
35. 0.001 0.001 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..39.36 rows=1 width=46) (actual time=0.001..0.001 rows=0 loops=1)

36. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on user_events_in_range events_4 (cost=0.00..16.88 rows=1 width=46) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((events_4.action = ANY ('{1,2}'::integer[])) AND ((events_4.target_type)::text = 'DesignManagement::Design'::text))
  • Rows Removed by Filter: 0
37. 0.000 0.000 ↓ 0.0 0 0

Nested Loop Left Join (cost=0.87..22.48 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((project_features_4.issues_access_level > 0) OR (project_features_4.issues_access_level IS NULL))
  • Rows Removed by Filter: 0
38. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using projects_pkey on public.projects projects_4 (cost=0.43..19.02 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((projects_4.id = events_4.project_id) AND (projects_4.id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[])))
  • Heap Fetches: 0
39. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_project_features_on_project_id on public.project_features project_features_4 (cost=0.43..3.45 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects_4.id = project_features_4.project_id)
40. 0.000 0.005 ↓ 0.0 0 1

Subquery Scan on *SELECT* 6 (cost=42.97..43.01 rows=1 width=50) (actual time=0.005..0.005 rows=0 loops=1)

41. 0.001 0.005 ↓ 0.0 0 1

Aggregate (cost=42.97..43.00 rows=1 width=60) (actual time=0.004..0.005 rows=0 loops=1)

  • Group Key: events_5.project_id, events_5.target_type, events_5.action, events_5.date, notes.noteable_type
42. 0.003 0.004 ↓ 0.0 0 1

Sort (cost=42.97..42.97 rows=1 width=56) (actual time=0.004..0.004 rows=0 loops=1)

  • Sort Key: events_5.project_id, events_5.date
  • Sort Method: quicksort Memory: 25kB
43. 0.000 0.001 ↓ 0.0 0 1

Nested Loop (cost=1.44..42.96 rows=1 width=56) (actual time=0.001..0.001 rows=0 loops=1)

44. 0.001 0.001 ↓ 0.0 0 1

Nested Loop Semi Join (cost=0.87..39.36 rows=1 width=50) (actual time=0.001..0.001 rows=0 loops=1)

45. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on user_events_in_range events_5 (cost=0.00..16.88 rows=1 width=50) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (((events_5.target_type)::text = 'Note'::text) AND (events_5.action = 6))
  • Rows Removed by Filter: 0
46. 0.000 0.000 ↓ 0.0 0 0

Nested Loop Left Join (cost=0.87..22.48 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((project_features_5.merge_requests_access_level > 0) OR (project_features_5.merge_requests_access_level IS NULL))
  • Rows Removed by Filter: 0
47. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using projects_pkey on public.projects projects_5 (cost=0.43..19.02 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((projects_5.id = events_5.project_id) AND (projects_5.id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[])))
  • Heap Fetches: 0
48. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_project_features_on_project_id on public.project_features project_features_5 (cost=0.43..3.45 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (projects_5.id = project_features_5.project_id)
49. 0.000 0.000 ↓ 0.0 0 0

Index Scan using notes_pkey on public.notes (cost=0.57..3.59 rows=1 width=14) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (notes.id = events_5.target_id)
  • Filter: ((notes.noteable_type)::text = 'MergeRequest'::text)
  • Rows Removed by Filter: 0
50. 0.000 0.006 ↓ 0.0 0 1

Subquery Scan on *SELECT* 7 (cost=28.07..28.11 rows=1 width=50) (actual time=0.006..0.006 rows=0 loops=1)

51. 0.001 0.006 ↓ 0.0 0 1

Aggregate (cost=28.07..28.10 rows=1 width=60) (actual time=0.005..0.006 rows=0 loops=1)

  • Group Key: events_6.project_id, events_6.target_type, events_6.action, events_6.date, notes_1.noteable_type
52. 0.004 0.005 ↓ 0.0 0 1

Sort (cost=28.07..28.08 rows=1 width=56) (actual time=0.005..0.005 rows=0 loops=1)

  • Sort Key: events_6.project_id, events_6.date, notes_1.noteable_type
  • Sort Method: quicksort Memory: 25kB
53. 0.001 0.001 ↓ 0.0 0 1

Nested Loop (cost=0.57..28.06 rows=1 width=56) (actual time=0.000..0.001 rows=0 loops=1)

54. 0.000 0.000 ↓ 0.0 0 1

CTE Scan on user_events_in_range events_6 (cost=0.00..24.47 rows=1 width=50) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (((events_6.target_type)::text = 'Note'::text) AND (events_6.action = 6) AND (events_6.project_id = ANY ('{53,42,41,40,39,38,37,36,35}'::integer[])))
  • Rows Removed by Filter: 0
55. 0.000 0.000 ↓ 0.0 0 0

Index Scan using notes_pkey on public.notes notes_1 (cost=0.57..3.59 rows=1 width=14) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (notes_1.id = events_6.target_id)
  • Filter: ((notes_1.noteable_type)::text <> 'MergeRequest'::text)
  • Rows Removed by Filter: 0