explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KL1T

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=69,764.61..69,764.68 rows=1 width=628) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=69,764.61..69,764.61 rows=1 width=628) (actual rows= loops=)

  • Sort Key: q2.region_name, q2.region_id, q2.group_id
3. 0.000 0.000 ↓ 0.0

Subquery Scan on q2 (cost=69,764.58..69,764.60 rows=1 width=628) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

HashAggregate (cost=69,764.58..69,764.59 rows=1 width=639) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

HashAggregate (cost=69,764.21..69,764.22 rows=1 width=630) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=35,344.70..69,764.16 rows=1 width=630) (actual rows= loops=)

  • Join Filter: ((machine_tasks.work_type_id = agro_operations.work_type_id) AND (history_items.field_id = agro_operations.field_id))
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=35,344.70..69,718.63 rows=7 width=646) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=35,344.70..69,710.91 rows=1 width=654) (actual rows= loops=)

  • Join Filter: (fields.id = public.machine_task_field_mapping_items.field_id)
9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=35,344.70..69,705.83 rows=1 width=134) (actual rows= loops=)

  • Filter: (get_field_cnt_work(2020, fields.id) > 2)
10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=35,344.70..69,679.12 rows=4 width=109) (actual rows= loops=)

  • Join Filter: (work_types.id = machine_tasks.work_type_id)
11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=35,344.70..69,668.71 rows=4 width=78) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=35,344.70..69,644.93 rows=4 width=78) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Hash Join (cost=35,344.70..69,579.75 rows=10 width=70) (actual rows= loops=)

  • Hash Cond: ((public.machine_task_field_mapping_items.field_id = history_items.field_id) AND (public.machine_task_field_mapping_items.machine_task_id = public.machine_task_field_mapping_items.machine_task_id))
14. 0.000 0.000 ↓ 0.0

Seq Scan on machine_task_field_mapping_items (cost=0.00..31,081.29 rows=40,061 width=32) (actual rows= loops=)

  • Filter: ((covered_area >= 1::double precision) AND (work_duration >= 600::double precision))
15. 0.000 0.000 ↓ 0.0

Hash (cost=34,756.68..34,756.68 rows=25,735 width=38) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,701.04..34,756.68 rows=25,735 width=38) (actual rows= loops=)

  • Hash Cond: (public.machine_task_field_mapping_items.field_id = history_items.field_id)
17. 0.000 0.000 ↓ 0.0

Seq Scan on machine_task_field_mapping_items (cost=0.00..30,222.86 rows=171,686 width=8) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash (cost=1,690.48..1,690.48 rows=845 width=30) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Join (cost=124.63..1,690.48 rows=845 width=30) (actual rows= loops=)

  • Hash Cond: (history_items.crop_id = crops.id)
20. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on history_items (cost=120.33..1,656.41 rows=5,686 width=12) (actual rows= loops=)

  • Recheck Cond: (year = 2,020)
21. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on history_items_year (cost=0.00..118.91 rows=5,686 width=0) (actual rows= loops=)

  • Index Cond: (year = 2,020)
22. 0.000 0.000 ↓ 0.0

Hash (cost=3.02..3.02 rows=102 width=26) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on crops (cost=0.00..3.02 rows=102 width=26) (actual rows= loops=)

  • Filter: (id IS NOT NULL)
24. 0.000 0.000 ↓ 0.0

Index Scan using machine_tasks_pkey on machine_tasks (cost=0.00..6.51 rows=1 width=20) (actual rows= loops=)

  • Index Cond: (id = public.machine_task_field_mapping_items.machine_task_id)
  • Filter: ((start_time >= '2018-01-01 00:00:00'::timestamp without time zone) AND (end_time <= '2020-10-13 23:59:59'::timestamp without time zone) AND (season = 2,020) AND ((action_type)::text = 'agri'::text) AND ((status)::text = 'done'::text))
25. 0.000 0.000 ↓ 0.0

Index Scan using machines_pkey on machines (cost=0.00..5.94 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = machine_tasks.machine_id)
26. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..3.74 rows=116 width=31) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Seq Scan on work_types (cost=0.00..3.16 rows=116 width=31) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using fields_pkey on fields (cost=0.00..6.41 rows=1 width=25) (actual rows= loops=)

  • Index Cond: (id = public.machine_task_field_mapping_items.field_id)
29. 0.000 0.000 ↓ 0.0

Index Scan using field_groups_pkey on field_groups (cost=0.00..5.07 rows=1 width=524) (actual rows= loops=)

  • Index Cond: (id = fields.field_group_id)
30. 0.000 0.000 ↓ 0.0

Index Scan using machine_task_agro_operation_mapping_items_machine_task_id on machine_task_agro_operation_mapping_items (cost=0.00..7.67 rows=5 width=8) (actual rows= loops=)

  • Index Cond: (machine_task_id = public.machine_task_field_mapping_items.machine_task_id)
31. 0.000 0.000 ↓ 0.0

Index Scan using agro_operations_pkey on agro_operations (cost=0.00..6.49 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = machine_task_agro_operation_mapping_items.agro_operation_id)
  • Filter: (agri_work_plan_id IS NOT NULL)