explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CAY5

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 10,264.611 10,285.920 ↑ 97.0 15 1

Result (cost=224.46..12,337.33 rows=1,455 width=8,707) (actual time=636.915..10,285.920 rows=15 loops=1)

  • Buffers: shared hit=5,031,216
2. 0.178 21.309 ↑ 97.0 15 1

Sort (cost=224.46..228.09 rows=1,455 width=8,189) (actual time=21.284..21.309 rows=15 loops=1)

  • Sort Key: (lpad((c.code)::text, 10, '0'::text)), (lpad((d.code)::text, 10, '0'::text))
  • Sort Method: quicksort Memory: 36kB
  • Buffers: shared hit=2,838
3. 0.217 21.131 ↑ 97.0 15 1

Nested Loop Left Join (cost=12.12..148.02 rows=1,455 width=8,189) (actual time=4.873..21.131 rows=15 loops=1)

  • Buffers: shared hit=2,835
4. 0.029 10.999 ↓ 15.0 15 1

Nested Loop Semi Join (cost=11.48..63.64 rows=1 width=333) (actual time=1.590..10.999 rows=15 loops=1)

  • Join Filter: ((wkfs.id_season = a.id_season) OR (wkfs.id_season = 0))
  • Buffers: shared hit=1,553
5. 0.024 10.925 ↓ 15.0 15 1

Nested Loop Semi Join (cost=11.21..63.31 rows=1 width=341) (actual time=1.579..10.925 rows=15 loops=1)

  • Join Filter: (d.id = vehs.id_vehicle)
  • Buffers: shared hit=1,508
6. 0.031 10.826 ↓ 15.0 15 1

Nested Loop Left Join (cost=10.93..62.82 rows=1 width=349) (actual time=1.569..10.826 rows=15 loops=1)

  • Buffers: shared hit=1,445
7. 0.023 10.795 ↓ 15.0 15 1

Nested Loop Left Join (cost=10.80..62.54 rows=1 width=325) (actual time=1.565..10.795 rows=15 loops=1)

  • Buffers: shared hit=1,445
8. 0.023 10.742 ↓ 15.0 15 1

Nested Loop Left Join (cost=10.65..62.37 rows=1 width=325) (actual time=1.560..10.742 rows=15 loops=1)

  • Buffers: shared hit=1,430
9. 0.029 10.689 ↓ 15.0 15 1

Nested Loop Left Join (cost=10.51..62.10 rows=1 width=309) (actual time=1.554..10.689 rows=15 loops=1)

  • Buffers: shared hit=1,415
10. 0.028 10.630 ↓ 15.0 15 1

Nested Loop Left Join (cost=10.37..61.94 rows=1 width=290) (actual time=1.549..10.630 rows=15 loops=1)

  • Buffers: shared hit=1,385
11. 0.021 10.542 ↓ 15.0 15 1

Nested Loop Left Join (cost=10.08..61.09 rows=1 width=268) (actual time=1.539..10.542 rows=15 loops=1)

  • Buffers: shared hit=1,340
12. 0.036 10.491 ↓ 15.0 15 1

Nested Loop (cost=9.80..57.33 rows=1 width=241) (actual time=1.532..10.491 rows=15 loops=1)

  • Buffers: shared hit=1,295
13. 0.064 10.395 ↓ 15.0 15 1

Nested Loop (cost=9.51..55.96 rows=1 width=206) (actual time=1.525..10.395 rows=15 loops=1)

  • Join Filter: (d.id = a.id_vehicle)
  • Buffers: shared hit=1,250
14. 0.041 8.051 ↓ 15.0 15 1

Nested Loop (cost=8.93..51.36 rows=1 width=126) (actual time=1.514..8.051 rows=15 loops=1)

  • Buffers: shared hit=840
15. 0.025 0.150 ↓ 3.8 15 1

Nested Loop (cost=8.65..35.62 rows=4 width=39) (actual time=0.058..0.150 rows=15 loops=1)

  • Buffers: shared hit=26
16. 0.016 0.035 ↓ 3.0 3 1

Bitmap Heap Scan on workfront c (cost=4.30..10.84 rows=1 width=23) (actual time=0.028..0.035 rows=3 loops=1)

  • Recheck Cond: (id_control = 40)
  • Filter: ((id_agron_module = 3) AND (id_company_manager = 24))
  • Heap Blocks: exact=2
  • Buffers: shared hit=7
17. 0.019 0.019 ↑ 1.0 3 1

Bitmap Index Scan on idx_workfront_control (cost=0.00..4.29 rows=3 width=0) (actual time=0.018..0.019 rows=3 loops=1)

  • Index Cond: (id_control = 40)
  • Buffers: shared hit=5
18. 0.060 0.090 ↑ 1.8 5 3

Bitmap Heap Scan on workfront_plan_vehicle b (cost=4.35..24.69 rows=9 width=16) (actual time=0.015..0.030 rows=5 loops=3)

  • Recheck Cond: (id_workfront = c.id)
  • Filter: ((CURRENT_TIMESTAMP >= plan_start) AND (CURRENT_TIMESTAMP <= plan_end))
  • Heap Blocks: exact=13
  • Buffers: shared hit=19
19. 0.030 0.030 ↑ 2.0 5 3

Bitmap Index Scan on idx_workfront_plan_vehicle_workfront (cost=0.00..4.35 rows=10 width=0) (actual time=0.010..0.010 rows=5 loops=3)

  • Index Cond: (id_workfront = c.id)
  • Buffers: shared hit=6
20. 7.860 7.860 ↑ 1.0 1 15

Index Scan using pk_vehicle on vehicle d (cost=0.28..3.93 rows=1 width=87) (actual time=0.524..0.524 rows=1 loops=15)

  • Index Cond: (id = b.id_vehicle)
  • Filter: ((active IS TRUE) AND (id_agron_module = 3) AND (utils.fn_vehicle_has_association_with_ti(id) IS TRUE))
  • Buffers: shared hit=814
21. 2.220 2.280 ↑ 1.0 1 15

Bitmap Heap Scan on monitoring_status a (cost=0.58..4.59 rows=1 width=80) (actual time=0.152..0.152 rows=1 loops=15)

  • Recheck Cond: (id_vehicle = b.id_vehicle)
  • Heap Blocks: exact=378
  • Buffers: shared hit=410
22. 0.060 0.060 ↓ 25.0 25 15

Bitmap Index Scan on uk_monitoring_status_2 (cost=0.00..0.58 rows=1 width=0) (actual time=0.004..0.004 rows=25 loops=15)

  • Index Cond: (id_vehicle = b.id_vehicle)
  • Buffers: shared hit=32
23. 0.060 0.060 ↑ 1.0 1 15

Index Scan using pk_activity on activity g (cost=0.29..1.37 rows=1 width=35) (actual time=0.004..0.004 rows=1 loops=15)

  • Index Cond: (id = a.id_activity)
  • Buffers: shared hit=45
24. 0.030 0.030 ↑ 1.0 1 15

Index Scan using pk_activity on activity g1 (cost=0.29..3.76 rows=1 width=35) (actual time=0.002..0.002 rows=1 loops=15)

  • Index Cond: (id = d.id_last_activity)
  • Buffers: shared hit=45
25. 0.060 0.060 ↑ 1.0 1 15

Index Scan using pk_implement on implement e (cost=0.29..0.85 rows=1 width=30) (actual time=0.004..0.004 rows=1 loops=15)

  • Index Cond: (id = a.id_implement)
  • Filter: (active IS TRUE)
  • Buffers: shared hit=45
26. 0.030 0.030 ↑ 1.0 1 15

Index Scan using pk_implement_type on implement_type f (cost=0.14..0.16 rows=1 width=27) (actual time=0.002..0.002 rows=1 loops=15)

  • Index Cond: (id = e.id_implement_type)
  • Buffers: shared hit=30
27. 0.030 0.030 ↓ 0.0 0 15

Index Scan using uk_alert on alert al (cost=0.14..0.25 rows=1 width=32) (actual time=0.002..0.002 rows=0 loops=15)

  • Index Cond: (id_vehicle = a.id_vehicle)
  • Filter: (id_activity = a.id_activity)
  • Buffers: shared hit=15
28. 0.030 0.030 ↓ 0.0 0 15

Index Scan using uk_alert_type on alert_type at (cost=0.14..0.18 rows=1 width=24) (actual time=0.002..0.002 rows=0 loops=15)

  • Index Cond: ((id_vehicle_type = a.id_vehicle_type) AND (id_activity = a.id_activity))
  • Filter: (active IS TRUE)
  • Buffers: shared hit=15
29. 0.000 0.000 ↓ 0.0 0 15

Index Scan using pk_decision_tree on decision_tree dt (cost=0.13..0.20 rows=1 width=32) (actual time=0.000..0.000 rows=0 loops=15)

  • Index Cond: (id = at.id_decision_tree)
  • Filter: (active IS TRUE)
30. 0.075 0.075 ↑ 1.0 1 15

Index Scan using idx_vehicle_season_vehicle on vehicle_season vehs (cost=0.28..0.48 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=15)

  • Index Cond: (id_vehicle = a.id_vehicle)
  • Filter: ((id_season = a.id_season) OR (id_season = 0))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=63
31. 0.045 0.045 ↑ 1.0 1 15

Index Scan using idx_workfront_season_workfront on workfront_season wkfs (cost=0.27..0.32 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=15)

  • Index Cond: (id_workfront = b.id_workfront)
  • Buffers: shared hit=45
32. 9.915 9.915 ↑ 2,550.0 1 15

Function Scan on get_structure_by_levels_table_less i (cost=0.64..26.14 rows=2,550 width=7,740) (actual time=0.661..0.661 rows=1 loops=15)

  • Buffers: shared hit=1,282
Planning time : 7.953 ms
Execution time : 10,287.511 ms