explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1han : Optimization for: Optimization for: Optimization for: plan #5KhA; plan #4lF6; plan #PrUk

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.008 22.411 ↑ 1.0 20 1

Limit (cost=1.27..8,330.43 rows=20 width=66) (actual time=2.426..22.411 rows=20 loops=1)

2. 0.200 22.403 ↑ 11.2 20 1

Nested Loop (cost=1.27..92,871.41 rows=223 width=66) (actual time=2.425..22.403 rows=20 loops=1)

3. 0.556 19.575 ↑ 1.4 657 1

Nested Loop (cost=0.85..92,348.80 rows=922 width=55) (actual time=0.073..19.575 rows=657 loops=1)

4. 17.048 17.048 ↑ 1.4 657 1

Index Scan using salary_employee_id_amount_is_last_salary_idx on salary (cost=0.43..86,463.12 rows=922 width=20) (actual time=0.067..17.048 rows=657 loops=1)

  • Index Cond: ((amount >= 120,000) AND (is_last_salary = true))
  • Filter: is_last_salary
5. 1.971 1.971 ↑ 1.0 1 657

Index Scan using idx_16988_primary on employee (cost=0.42..6.38 rows=1 width=35) (actual time=0.003..0.003 rows=1 loops=657)

  • Index Cond: (id = salary.employee_id)
6. 2.628 2.628 ↓ 0.0 0 657

Index Scan using title_employee_id_is_last_title_idx on title (cost=0.42..0.56 rows=1 width=27) (actual time=0.004..0.004 rows=0 loops=657)

  • Index Cond: ((employee_id = employee.id) AND (is_last_title = true))
  • Filter: (is_last_title AND ((title)::text = 'Staff'::text))
  • Rows Removed by Filter: 1
Planning time : 9.535 ms
Execution time : 22.453 ms