explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TTmN

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 48,232.603 ↓ 10.0 20 1

Limit (cost=31,347.36..31,347.36 rows=2 width=1,258) (actual time=48,232.598..48,232.603 rows=20 loops=1)

  • Buffers: shared hit=281,114 read=56,779 written=1
  • I/O Timings: read=46,615.214 write=1.552
2. 37.087 48,232.598 ↓ 10.0 20 1

Sort (cost=31,347.36..31,347.36 rows=2 width=1,258) (actual time=48,232.595..48,232.598 rows=20 loops=1)

  • Sort Key: ((milestones.due_date IS NULL)), ((milestones.id IS NULL)), milestones.due_date DESC, issues.id DESC
  • Sort Method: top-N heapsort Memory: 93kB
  • Buffers: shared hit=281,114 read=56,779 written=1
  • I/O Timings: read=46,615.214 write=1.552
3. 25.139 48,195.511 ↓ 3,174.5 6,349 1

Nested Loop Left Join (cost=1,420.62..31,347.35 rows=2 width=1,258) (actual time=6,021.751..48,195.511 rows=6,349 loops=1)

  • Buffers: shared hit=281,114 read=56,779 written=1
  • I/O Timings: read=46,615.214 write=1.552
4. 35.877 48,119.580 ↓ 3,174.5 6,349 1

Nested Loop Left Join (cost=1,420.20..31,346.46 rows=2 width=1,252) (actual time=6,021.742..48,119.580 rows=6,349 loops=1)

  • Filter: ((project_features.issues_access_level IS NULL) OR (project_features.issues_access_level = ANY ('{20,30}'::integer[])) OR ((project_features.issues_access_level = 10) AND (alternatives: SubPlan 3 or hashed SubPlan 4)))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=266,760 read=56,773 written=1
  • I/O Timings: read=46,597.123 write=1.552
5. 139.156 48,013.851 ↓ 3,174.5 6,349 1

Nested Loop Semi Join (cost=1,419.76..31,338.26 rows=2 width=1,256) (actual time=6,021.710..48,013.851 rows=6,349 loops=1)

  • Buffers: shared hit=241,358 read=56,773 written=1
  • I/O Timings: read=46,597.123 write=1.552
6. 60.752 46,157.323 ↓ 16.8 45,194 1

Nested Loop (cost=1,419.20..29,379.51 rows=2,697 width=1,256) (actual time=4.391..46,157.323 rows=45,194 loops=1)

  • Buffers: shared hit=23,729 read=32,882
  • I/O Timings: read=45,634.666
7. 0.843 18.957 ↑ 1.7 979 1

Nested Loop (cost=1,418.63..16,399.75 rows=1,633 width=4) (actual time=1.535..18.957 rows=979 loops=1)

  • Buffers: shared hit=6,367
8. 0.283 1.739 ↑ 1.3 125 1

HashAggregate (cost=1,418.20..1,419.81 rows=161 width=4) (actual time=1.503..1.739 rows=125 loops=1)

  • Group Key: namespaces.id
  • Buffers: shared hit=627
9. 1.456 1.456 ↑ 1.3 125 1

CTE Scan on base_and_descendants namespaces (cost=1,412.97..1,416.19 rows=161 width=4) (actual time=0.040..1.456 rows=125 loops=1)

  • Buffers: shared hit=627
10.          

CTE base_and_descendants

11. 0.300 1.289 ↑ 1.3 125 1

Recursive Union (cost=0.43..1,412.97 rows=161 width=329) (actual time=0.037..1.289 rows=125 loops=1)

  • Buffers: shared hit=627
12. 0.029 0.029 ↑ 1.0 1 1

Index Scan using namespaces_pkey on public.namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=329) (actual time=0.028..0.029 rows=1 loops=1)

  • Index Cond: (namespaces_1.id = 9,970)
  • Filter: ((namespaces_1.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=4
13. 0.070 0.960 ↓ 1.6 25 5

Nested Loop (cost=0.56..140.63 rows=16 width=329) (actual time=0.018..0.192 rows=25 loops=5)

  • Buffers: shared hit=623
14. 0.015 0.015 ↓ 2.5 25 5

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (actual time=0.001..0.003 rows=25 loops=5)

15. 0.875 0.875 ↑ 2.0 1 125

Index Scan using index_namespaces_on_parent_id_and_id on public.namespaces namespaces_2 (cost=0.56..14.02 rows=2 width=329) (actual time=0.005..0.007 rows=1 loops=125)

  • Index Cond: (namespaces_2.parent_id = base_and_descendants.id)
  • Filter: ((namespaces_2.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=623
16. 8.543 16.375 ↑ 1.2 8 125

Index Scan using index_projects_on_namespace_id_and_id on public.projects (cost=0.43..92.94 rows=10 width=8) (actual time=0.022..0.131 rows=8 loops=125)

  • Index Cond: (projects.namespace_id = namespaces.id)
  • Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (projects.visibility_level = ANY ('{10,20}'::integer[])))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=5,740
17.          

SubPlan (for Index Scan)

18. 7.832 7.832 ↑ 1.0 1 979

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations (cost=0.57..3.59 rows=1 width=0) (actual time=0.008..0.008 rows=1 loops=979)

  • Index Cond: ((project_authorizations.user_id = 4,156,052) AND (project_authorizations.project_id = projects.id) AND (project_authorizations.access_level >= 10))
  • Heap Fetches: 113
  • Buffers: shared hit=4,383
19. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations project_authorizations_1 (cost=0.57..272.02 rows=1,222 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((project_authorizations_1.user_id = 4,156,052) AND (project_authorizations_1.access_level >= 10))
  • Heap Fetches: 0
20. 46,077.614 46,077.614 ↑ 3.8 46 979

Index Scan using idx_issues_on_project_id_and_rel_position_and_state_id_and_id on public.issues (cost=0.56..6.18 rows=177 width=1,252) (actual time=0.486..47.066 rows=46 loops=979)

  • Index Cond: ((issues.project_id = projects.id) AND (issues.state_id = 1))
  • Buffers: shared hit=17,362 read=32,882
  • I/O Timings: read=45,634.666
21. 1,717.372 1,717.372 ↓ 0.0 0 45,194

Index Only Scan using index_on_label_links_all_columns on public.label_links (cost=0.56..0.73 rows=1 width=4) (actual time=0.038..0.038 rows=0 loops=45,194)

  • Index Cond: ((label_links.target_id = issues.id) AND (label_links.target_type = 'Issue'::text))
  • Heap Fetches: 1,573
  • Filter: (label_links.label_id = ANY ('{1924053,2191076,2229310,2251841,2278648,2379994,2414262,3519299,3791725,3892549,3892770,3899495,3969396,3999541,3999564,4007552,4007738,4049204,4057321,4063693,4117093,6190961,7142293,7157910,7256789,7717873,7841215,8761704,8827899,8828075,8828148,9084503,10778837,10778846,11602405,12073682,12932265,13682327,15339054}'::integer[]))
  • Rows Removed by Filter: 4
  • Buffers: shared hit=217,629 read=23,891 written=1
  • I/O Timings: read=962.457 write=1.552
22. 69.839 69.839 ↑ 1.0 1 6,349

Index Scan using index_project_features_on_project_id on public.project_features (cost=0.43..0.49 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=6,349)

  • Index Cond: (projects.id = project_features.project_id)
  • Buffers: shared hit=25,396
23.          

SubPlan (for Nested Loop Left Join)

24. 0.013 0.013 ↑ 1.0 1 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations project_authorizations_2 (cost=0.57..3.59 rows=1 width=0) (actual time=0.013..0.013 rows=1 loops=1)

  • Index Cond: ((project_authorizations_2.user_id = 4,156,052) AND (project_authorizations_2.project_id = projects.id) AND (project_authorizations_2.access_level >= 10))
  • Heap Fetches: 1
  • Buffers: shared hit=6
25. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations project_authorizations_3 (cost=0.57..272.02 rows=1,222 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((project_authorizations_3.user_id = 4,156,052) AND (project_authorizations_3.access_level >= 10))
  • Heap Fetches: 0
26. 50.792 50.792 ↑ 1.0 1 6,349

Index Scan using milestones_pkey on public.milestones (cost=0.42..0.44 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=6,349)

  • Index Cond: (issues.milestone_id = milestones.id)
  • Buffers: shared hit=14,354 read=6
  • I/O Timings: read=18.091