explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vs0g : Optimization for: Optimization for: plan #yUoW; plan #DDBr

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.005 4,481.415 ↓ 6.0 6 1

Limit (cost=143,965.79..143,965.79 rows=1 width=284) (actual time=4,481.413..4,481.415 rows=6 loops=1)

2. 0.044 4,481.410 ↓ 1.5 26 1

Sort (cost=143,965.75..143,965.79 rows=17 width=284) (actual time=4,481.408..4,481.410 rows=26 loops=1)

  • Sort Key: departments.rgt
  • Sort Method: quicksort Memory: 31kB
3. 0.040 4,481.366 ↓ 1.5 26 1

Nested Loop Left Join (cost=0.28..143,965.40 rows=17 width=284) (actual time=3,196.690..4,481.366 rows=26 loops=1)

  • Join Filter: (accounts.id = departments.account_id)
4. 4,481.300 4,481.300 ↓ 1.5 26 1

Seq Scan on departments (cost=0.00..143,956.85 rows=17 width=108) (actual time=3,196.655..4,481.300 rows=26 loops=1)

  • Filter: (account_id = 844)
  • Rows Removed by Filter: 12,100
5. 0.008 0.026 ↑ 1.0 1 26

Materialize (cost=0.28..8.30 rows=1 width=176) (actual time=0.001..0.001 rows=1 loops=26)

6. 0.018 0.018 ↑ 1.0 1 1

Index Scan using accounts_pkey on accounts (cost=0.28..8.29 rows=1 width=176) (actual time=0.017..0.018 rows=1 loops=1)

  • Index Cond: (id = 844)
  • Filter: (deleted_at IS NULL)
Planning time : 0.316 ms
Execution time : 4,481.492 ms