explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5P91

Settings
# exclusive inclusive rows x rows loops node
1. 934.623 1,323.365 ↓ 8.6 208,599 1

Sort (cost=51,839.96..51,900.67 rows=24,284 width=1,310) (actual time=1,138.586..1,323.365 rows=208,599 loops=1)

  • Sort Key: slr_departmen.code, slr_departmen.short_name
  • Sort Method: external merge Disk: 105,704kB
2. 129.345 388.742 ↓ 8.6 208,599 1

Nested Loop (cost=1.14..36,207.65 rows=24,284 width=1,310) (actual time=1.472..388.742 rows=208,599 loops=1)

  • Join Filter: (slr_departmen.id = t3.department_id)
3. 3.208 16.966 ↓ 2.1 4,109 1

Nested Loop (cost=0.71..31,488.58 rows=1,917 width=1,314) (actual time=1.460..16.966 rows=4,109 loops=1)

4. 0.316 9.573 ↓ 1.0 155 1

Nested Loop Left Join (cost=0.29..2,879.77 rows=152 width=1,310) (actual time=0.261..9.573 rows=155 loops=1)

  • Join Filter: (slr_departmen.place_group_id = slr_dict_place_group.id)
  • Rows Removed by Join Filter: 620
5. 0.673 9.102 ↓ 1.0 155 1

Nested Loop Left Join (cost=0.29..2,869.60 rows=152 width=732) (actual time=0.241..9.102 rows=155 loops=1)

6. 7.654 7.654 ↓ 1.0 155 1

Seq Scan on slr_departmen (cost=0.00..1,902.86 rows=152 width=366) (actual time=0.214..7.654 rows=155 loops=1)

  • Filter: ((("end" >= '2020-01-01'::date) OR ("end" IS NULL)) AND (begin <= '2020-01-31'::date) AND (ent_id = 3,948) AND (state = 0))
  • Rows Removed by Filter: 35,938
7. 0.775 0.775 ↑ 1.0 1 155

Index Scan using slr_departmen_pkey on slr_departmen t4 (cost=0.29..6.36 rows=1 width=366) (actual time=0.005..0.005 rows=1 loops=155)

  • Index Cond: (slr_departmen.parent_id = id)
8. 0.147 0.155 ↑ 1.0 4 155

Materialize (cost=0.00..1.06 rows=4 width=578) (actual time=0.000..0.001 rows=4 loops=155)

9. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on slr_dict_place_group (cost=0.00..1.04 rows=4 width=578) (actual time=0.007..0.008 rows=4 loops=1)

10. 4.185 4.185 ↑ 1.4 27 155

Index Scan using slr_employee_department_id on slr_employee (cost=0.42..187.85 rows=37 width=4) (actual time=0.008..0.027 rows=27 loops=155)

  • Index Cond: (department_id = slr_departmen.id)
  • Filter: ((admission_date <= '2020-01-31'::date) AND ((lay_off_date IS NULL) OR (lay_off_date >= '2020-01-01'::date)))
  • Rows Removed by Filter: 9
11. 242.431 242.431 ↓ 1.4 51 4,109

Index Scan using slr_employee_department_id on slr_employee t3 (cost=0.42..2.00 rows=37 width=4) (actual time=0.006..0.059 rows=51 loops=4,109)

  • Index Cond: (department_id = slr_employee.department_id)
  • Filter: (job_type = 1)
  • Rows Removed by Filter: 40
Planning time : 1.808 ms
Execution time : 1,355.385 ms