explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5rZL

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 1.071 ↑ 1.0 20 1

Limit (cost=560.58..560.63 rows=20 width=43) (actual time=1.067..1.071 rows=20 loops=1)

2. 0.078 1.068 ↑ 20.0 20 1

Sort (cost=560.58..561.58 rows=400 width=43) (actual time=1.066..1.068 rows=20 loops=1)

  • Sort Key: events.id DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 0.070 0.990 ↑ 1.8 217 1

Nested Loop (cost=1.57..549.94 rows=400 width=43) (actual time=0.076..0.990 rows=217 loops=1)

4. 0.002 0.220 ↑ 1.0 20 1

Limit (cost=1.00..70.98 rows=20 width=4) (actual time=0.054..0.220 rows=20 loops=1)

5. 0.000 0.218 ↑ 124.0 20 1

Nested Loop (cost=1.00..8,678.30 rows=2,480 width=4) (actual time=0.054..0.218 rows=20 loops=1)

6. 0.044 0.044 ↑ 114.5 22 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.039..0.044 rows=22 loops=1)

  • Index Cond: (user_id = 64248)
  • Heap Fetches: 5
7. 0.176 0.176 ↑ 1.0 1 22

Index Scan using projects_pkey on projects (cost=0.43..3.40 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=22)

  • Index Cond: (id = project_authorizations.project_id)
  • Filter: (NOT archived)
  • Rows Removed by Filter: 0
8. 0.020 0.700 ↑ 1.8 11 20

Limit (cost=0.57..23.54 rows=20 width=43) (actual time=0.010..0.035 rows=11 loops=20)

9. 0.680 0.680 ↑ 96.7 11 20

Index Scan Backward using index_events_on_project_id_and_id on events (cost=0.57..1,222.33 rows=1,064 width=43) (actual time=0.010..0.034 rows=11 loops=20)

  • Index Cond: (project_id = projects.id)
Planning time : 0.609 ms
Execution time : 1.110 ms