explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wNNT

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

Sort (cost=879,666.06..879,666.07 rows=1 width=607) (actual rows= loops=)

  • Sort Key: ranked_data.plot_id, ranked_data.pm_latitude, ranked_data.pm_longitude, ranked_data.crop_id, ranked_data.pest_id, ranked_data.task_type_id, ranked_data.pm_start_time
  • Functions: 49
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
2. 0.000 0.000 ↓ 0.0

Subquery Scan on ranked_data (cost=879,666.01..879,666.05 rows=1 width=607) (actual rows= loops=)

  • Filter: (ranked_data.rank = 1)
3. 0.000 0.000 ↓ 0.0

WindowAgg (cost=879,666.01..879,666.04 rows=1 width=615) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Sort (cost=879,666.01..879,666.02 rows=1 width=607) (actual rows= loops=)

  • Sort Key: plot.id, pest.id, (date_trunc('day'::text, pm.start_time)) DESC
5. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,111.26..879,666.00 rows=1 width=607) (actual rows= loops=)

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

Nested Loop Left Join (cost=1,110.85..870,354.31 rows=1 width=535) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,110.57..870,347.20 rows=1 width=491) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,110.29..870,340.06 rows=1 width=491) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,110.00..870,332.75 rows=1 width=393) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,109.86..870,327.42 rows=1 width=401) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,109.57..870,319.99 rows=1 width=324) (actual rows= loops=)

  • Filter: ((farm.id IS NULL) OR (farm.id = ANY ('{72155209181298692,72155209181298690,72155209181364233,72155209181298693,72155209181364230,72155209181298689,72155209181364231,72155209181364227,72155209181298691,72155209181364229,72155209181364226,72155209181364228,72155209181364232,72155209181364225,72158478521860097}'::bigint[])))
12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,109.28..866,569.27 rows=503 width=279) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using entity_type_pkey on entity_type pest (cost=0.29..56.78 rows=4 width=106) (actual rows= loops=)

  • Index Cond: (id = ANY ('{72148059951005697,72155118885208065,72155118883110913,72155118887108609,72155118888943617,72155804903997441,72155804901638145}'::bigint[]))
  • Filter: (main_type = 3)
14. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on pest_measurement pm (cost=1,109.00..216,624.02 rows=410 width=181) (actual rows= loops=)

  • Recheck Cond: (pest_id = pest.id)
  • Filter: ((start_time >= '2018-12-29 00:00:00'::timestamp without time zone) AND (start_time < '2019-01-29 00:00:00'::timestamp without time zone) AND (project_id = '72154491368833025'::bigint) AND (plan_status = ANY ('{1,7,0}'::integer[])))
15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on pest_measurement_pest_id_idx (cost=0.00..1,108.90 rows=59,777 width=0) (actual rows= loops=)

  • Index Cond: (pest_id = pest.id)
16. 0.000 0.000 ↓ 0.0

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

  • Index Cond: (id = pm.owner_loc_id)
17. 0.000 0.000 ↓ 0.0

Index Scan using location_pkey on location plot (cost=0.29..7.43 rows=1 width=85) (actual rows= loops=)

  • Index Cond: (id = pm.location_id)
18. 0.000 0.000 ↓ 0.0

Index Scan using location_type_pkey on location_type plot_type (cost=0.14..5.17 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = plot.type_id)
  • Filter: (main_type = 3)
19. 0.000 0.000 ↓ 0.0

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

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

Index Only Scan using task_type_pkey on task_type (cost=0.28..7.13 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = pm.type_id)
21. 0.000 0.000 ↓ 0.0

Index Scan using contact_info_pkey on contact_info (cost=0.28..7.10 rows=1 width=60) (actual rows= loops=)

  • Index Cond: (id = pm.user_id)
22. 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
  • -> Index Scan using action_file_action_id_idx on action_file (cost=0.42..5290.69 rows=113954 width=95)JIT: