explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2vMA

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 5,656.852 ↑ 1.0 10 1

Limit (cost=1.03..46,793.94 rows=10 width=4) (actual time=2.137..5,656.852 rows=10 loops=1)

2. 698.371 5,656.841 ↑ 4.6 10 1

Nested Loop Left Join (cost=1.03..215,248.42 rows=46 width=4) (actual time=2.134..5,656.841 rows=10 loops=1)

  • Filter: ((rs.user_id = 7) OR ((rs.user_id IS NULL) AND (ps.role = 'operator'::text)))
  • Rows Removed by Filter: 557589
3. 1,010.526 3,843.272 ↑ 1.0 557,599 1

Merge Left Join (cost=0.89..122,959.70 rows=557,649 width=12) (actual time=0.508..3,843.272 rows=557,599 loops=1)

  • Merge Cond: (r.last_request_state_id = rs.id)
4. 1,926.898 1,926.898 ↑ 1.0 557,599 1

Index Scan using idx__request__last_request_state_id on request r (cost=0.42..61,137.87 rows=557,649 width=8) (actual time=0.417..1,926.898 rows=557,599 loops=1)

  • Filter: (mfc_id = 1)
  • Rows Removed by Filter: 60
5. 905.848 905.848 ↑ 1.0 1,410,269 1

Index Scan using request_state_pkey on request_state rs (cost=0.43..51,325.56 rows=1,410,340 width=12) (actual time=0.010..905.848 rows=1,410,269 loops=1)

6. 1,115.198 1,115.198 ↑ 1.0 1 557,599

Index Scan using process_state_pkey on process_state ps (cost=0.14..0.15 rows=1 width=36) (actual time=0.002..0.002 rows=1 loops=557,599)

  • Index Cond: (id = rs.process_state_id)
Planning time : 0.956 ms
Execution time : 5,656.966 ms