explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Mt6s

Settings
# exclusive inclusive rows x rows loops node
1. 0.133 3,892.124 ↑ 1.0 1,000 1

Limit (cost=112,305.89..112,308.39 rows=1,000 width=725) (actual time=3,891.779..3,892.124 rows=1,000 loops=1)

  • Buffers: shared hit=9,472 read=91,076 dirtied=6,167
  • I/O Timings: read=3,444.261
2. 80.591 3,891.991 ↑ 1.1 1,000 1

Sort (cost=112,305.89..112,308.59 rows=1,080 width=725) (actual time=3,891.778..3,891.991 rows=1,000 loops=1)

  • Sort Key: merge_requests.id
  • Sort Method: top-N heapsort Memory: 993kB
  • Buffers: shared hit=9,472 read=91,076 dirtied=6,167
  • I/O Timings: read=3,444.261
3. 44.216 3,811.400 ↓ 68.6 74,118 1

Nested Loop (cost=1.44..112,251.48 rows=1,080 width=725) (actual time=655.538..3,811.400 rows=74,118 loops=1)

  • Buffers: shared hit=9,469 read=91,076 dirtied=6,167
  • I/O Timings: read=3,444.261
4. 0.692 701.040 ↑ 1.5 228 1

Nested Loop Left Join (cost=0.87..2,875.71 rows=333 width=4) (actual time=655.045..701.040 rows=228 loops=1)

  • Filter: ((project_features.merge_requests_access_level > 0) OR (project_features.merge_requests_access_level IS NULL))
  • Rows Removed by Filter: 9
  • Buffers: shared hit=1,225 read=1,230 dirtied=200
  • I/O Timings: read=683.862
5. 21.296 673.567 ↑ 1.4 237 1

Index Scan using index_projects_on_namespace_id_and_id on public.projects (cost=0.43..1,708.01 rows=337 width=4) (actual time=654.846..673.567 rows=237 loops=1)

  • Index Cond: (projects.namespace_id = 9,970)
  • Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (projects.visibility_level = ANY ('{0,10,20}'::integer[])))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=848 read=659 dirtied=193
  • I/O Timings: read=659.016
6.          

SubPlan (for Index Scan)

7. 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 (cost=0.57..3.59 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((project_authorizations.user_id = 4,014,344) AND (project_authorizations.project_id = projects.id))
  • Heap Fetches: 0
8. 652.271 652.271 ↓ 2.1 3,308 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations project_authorizations_1 (cost=0.57..360.76 rows=1,577 width=4) (actual time=6.230..652.271 rows=3,308 loops=1)

  • Index Cond: (project_authorizations_1.user_id = 4,014,344)
  • Heap Fetches: 511
  • Buffers: shared hit=844 read=419 dirtied=166
  • I/O Timings: read=641.617
9. 26.781 26.781 ↑ 1.0 1 237

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.113..0.113 rows=1 loops=237)

  • Index Cond: (projects.id = project_features.project_id)
  • Buffers: shared hit=377 read=571 dirtied=7
  • I/O Timings: read=24.846
10. 3,066.144 3,066.144 ↓ 1.5 325 228

Index Scan using index_merge_requests_target_project_id_created_at on public.merge_requests (cost=0.56..326.30 rows=216 width=725) (actual time=0.138..13.448 rows=325 loops=228)

  • Index Cond: (merge_requests.target_project_id = projects.id)
  • Filter: (merge_requests.state_id = 3)
  • Rows Removed by Filter: 68
  • Buffers: shared hit=8,244 read=89,846 dirtied=5,967
  • I/O Timings: read=2,760.399