explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k8X4 : Optimization for: plan #5rZL

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 86.080 ↑ 1.0 20 1

Limit (cost=69,364.09..69,364.14 rows=20 width=43) (actual time=86.073..86.080 rows=20 loops=1)

2. 4.133 86.078 ↑ 2,480.0 20 1

Sort (cost=69,364.09..69,488.09 rows=49,600 width=43) (actual time=86.072..86.078 rows=20 loops=1)

  • Sort Key: events.id DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 5.335 81.945 ↑ 2.1 24,137 1

Nested Loop (cost=1.57..68,044.25 rows=49,600 width=43) (actual time=0.065..81.945 rows=24,137 loops=1)

4. 1.313 14.084 ↑ 1.3 1,839 1

Nested Loop (cost=1.00..8,678.30 rows=2,480 width=4) (actual time=0.044..14.084 rows=1,839 loops=1)

5. 1.149 1.149 ↑ 1.3 1,937 1

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations (cost=0.56..80.30 rows=2,520 width=4) (actual time=0.029..1.149 rows=1,937 loops=1)

  • Index Cond: (user_id = 64248)
  • Heap Fetches: 286
6. 11.622 11.622 ↑ 1.0 1 1,937

Index Scan using projects_pkey on projects (cost=0.43..3.40 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1,937)

  • Index Cond: (id = project_authorizations.project_id)
  • Filter: (NOT archived)
  • Rows Removed by Filter: 0
7. 1.839 62.526 ↑ 1.5 13 1,839

Limit (cost=0.57..23.54 rows=20 width=43) (actual time=0.009..0.034 rows=13 loops=1,839)

8. 60.687 60.687 ↓ 0.0 13 1,839

Index Scan Backward using index_events_on_project_id_and_id on events (cost=0.57..1222.33 rows=1064 nwidth=43) (cost=0..0 rows=0 width=0) (actual time=0.009..0.033 rows=13 loops=1,839)

  • Index Cond: (project_id = projects.id)
Planning time : 0.625 ms
Execution time : 86.139 ms