explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hgcu

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

Limit (cost=6,766,236.39..6,766,236.39 rows=1 width=527) (actual rows= loops=)

  • Functions: 76
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
2. 0.000 0.000 ↓ 0.0

Sort (cost=6,766,236.39..6,766,236.39 rows=1 width=527) (actual rows= loops=)

  • Sort Key: plot.id, pm.latitude, pm.longitude, crop.id, pest.id, task_type.id, pm.start_time, pm.id
3. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=1,023.88..6,766,236.38 rows=1 width=527) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=1,023.31..6,766,220.74 rows=1 width=535) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,000.99..6,766,158.41 rows=1 width=543) (actual rows= loops=)

  • Join Filter: (action_file.action_id = pm.id)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.57..6,756,846.71 rows=1 width=479) (actual rows= loops=)

  • Join Filter: (pm.type_id = task_type.id)
7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.57..6,756,293.70 rows=1 width=479) (actual rows= loops=)

  • Join Filter: (pm.pest_id = pest.id)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.57..6,755,846.74 rows=1 width=373) (actual rows= loops=)

  • Join Filter: (pm.crop_id = crop.id)
9. 0.000 0.000 ↓ 0.0

Index Scan using entity_type_pkey on entity_type crop (cost=0.29..33,385.67 rows=9,865 width=106) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Materialize (cost=1,000.29..6,722,313.09 rows=1 width=267) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.29..6,722,313.09 rows=1 width=267) (actual rows= loops=)

  • Join Filter: (plot.type_id = plot_type.id)
12. 0.000 0.000 ↓ 0.0

Seq Scan on location_type plot_type (cost=0.00..5.91 rows=58 width=8) (actual rows= loops=)

  • Filter: (main_type = 3)
13. 0.000 0.000 ↓ 0.0

Materialize (cost=1,000.29..6,722,303.70 rows=4 width=275) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,000.29..6,722,303.68 rows=4 width=275) (actual rows= loops=)

  • Join Filter: (pm.location_id = plot.id)
15. 0.000 0.000 ↓ 0.0

Seq Scan on location plot (cost=0.00..678.74 rows=22,374 width=85) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Materialize (cost=1,000.29..6,720,282.51 rows=4 width=198) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,000.29..6,720,282.49 rows=4 width=198) (actual rows= loops=)

  • Join Filter: (farm.id = pm.owner_loc_id)
  • Filter: ((farm.id IS NULL) OR (farm.id = '72158380786122753'::bigint))
18. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..6,718,784.50 rows=85,125 width=153) (actual rows= loops=)

  • Workers Planned: 2
19. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on pest_measurement pm (cost=0.00..6,709,272.00 rows=35,469 width=153) (actual rows= loops=)

  • Filter: ((start_time >= '2019-03-07 00:00:00'::timestamp without time zone) AND (start_time < '2019-03-28 00:00:00'::timestamp without time zone) AND (owner_loc_id = '72158380786122753'::bigint) AND (project_id = '72153897141141505'::bigint) AND (plan_status = ANY ('{7,0,1,3}'::integer[])))
20. 0.000 0.000 ↓ 0.0

Materialize (cost=0.29..8.31 rows=1 width=53) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using location_pkey on location farm (cost=0.29..8.30 rows=1 width=53) (actual rows= loops=)

  • Index Cond: (id = '72158380786122753'::bigint)
22. 0.000 0.000 ↓ 0.0

Seq Scan on entity_type pest (cost=0.00..323.65 rows=9,865 width=106) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Seq Scan on task_type (cost=0.00..516.34 rows=2,934 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.42..7,753.75 rows=69,242 width=80) (actual rows= loops=)

  • Group Key: action_file.action_id
25. 0.000 0.000 ↓ 0.0

Index Scan using action_file_action_id_idx on action_file (cost=0.42..5,290.69 rows=113,954 width=95) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=22.32..62.33 rows=1 width=16) (actual rows= loops=)

  • Join Filter: ((et2_1.code)::text ~~ ((et3_1.code)::text || '%'::text))
27. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.86..22.94 rows=1 width=26) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Index Scan using entity_type_pkey on entity_type et2_1 (cost=0.29..7.31 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (id = pm.pest_id)
29. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..15.62 rows=1 width=8) (actual rows= loops=)

  • Join Filter: ((et2_2.code)::text ~~ ((et3_2.code)::text || '%'::text))
30. 0.000 0.000 ↓ 0.0

Index Scan using entity_type_pkey on entity_type et2_2 (cost=0.29..7.31 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (id = et2_1.id)
31. 0.000 0.000 ↓ 0.0

Index Only Scan using entity_type_code on entity_type et3_2 (cost=0.29..8.30 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (code = 'PT'::text)
32. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on entity_type et3_1 (cost=21.46..39.31 rows=5 width=10) (actual rows= loops=)

  • Recheck Cond: (id = ANY ('{72158475453071361,72158452898922497,72158475408572417,72158452900888577,72158475486101505}'::bigint[]))
33. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on entity_type_pkey (cost=0.00..21.46 rows=5 width=0) (actual rows= loops=)

  • Index Cond: (id = ANY ('{72158475453071361,72158452898922497,72158475408572417,72158452900888577,72158475486101505}'::bigint[]))
34. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..15.62 rows=1 width=8) (actual rows= loops=)

  • Join Filter: ((et2.code)::text ~~ ((et3.code)::text || '%'::text))
35. 0.000 0.000 ↓ 0.0

Index Scan using entity_type_pkey on entity_type et2 (cost=0.29..7.31 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (id = pm.crop_id)
36. 0.000 0.000 ↓ 0.0

Index Scan using entity_type_pkey on entity_type et3 (cost=0.29..8.30 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (id = '72142079263178753'::bigint)JIT: