explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5DmX

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 90,582.430 ↑ 1.0 9 1

Limit (cost=2,073,483.20..2,073,483.22 rows=9 width=16) (actual time=90,582.426..90,582.430 rows=9 loops=1)

2. 0.033 90,582.423 ↑ 7.7 9 1

Sort (cost=2,073,483.20..2,073,483.37 rows=69 width=16) (actual time=90,582.422..90,582.423 rows=9 loops=1)

  • Sort Key: pm.start_time DESC, pm.id
  • Sort Method: quicksort Memory: 25kB
3. 0.065 90,582.390 ↑ 4.9 14 1

Nested Loop (cost=0.57..2,073,481.76 rows=69 width=16) (actual time=90,574.366..90,582.390 rows=14 loops=1)

  • Join Filter: (plot.type_id = plot_type.id)
  • Rows Removed by Join Filter: 1232
4. 6.837 90,582.241 ↑ 8.2 14 1

Nested Loop (cost=0.57..2,073,323.46 rows=115 width=24) (actual time=90,574.309..90,582.241 rows=14 loops=1)

  • Join Filter: (pm.location_id = plot.id)
  • Rows Removed by Join Filter: 165872
5. 1.648 1.648 ↑ 1.0 11,849 1

Seq Scan on location plot (cost=0.00..362.49 rows=11,849 width=16) (actual time=0.567..1.648 rows=11,849 loops=1)

6. 8.228 90,573.756 ↑ 8.2 14 11,849

Materialize (cost=0.57..2,052,521.73 rows=115 width=24) (actual time=0.318..7.644 rows=14 loops=11,849)

7. 39,374.525 90,565.528 ↑ 8.2 14 1

Nested Loop (cost=0.57..2,052,521.15 rows=115 width=24) (actual time=3,764.792..90,565.528 rows=14 loops=1)

  • Join Filter: (pm.pest_id = pest.id)
  • Rows Removed by Join Filter: 683477319
8. 3.251 3.251 ↑ 1.0 539 1

Seq Scan on entity_type pest (cost=0.00..221.49 rows=540 width=8) (actual time=0.083..3.251 rows=539 loops=1)

  • Filter: ((id <> '72159269354733569'::bigint) AND (main_type = 5))
  • Rows Removed by Filter: 5427
9. 49,373.593 51,187.752 ↓ 1,000.0 1,268,047 539

Materialize (cost=0.57..2,042,032.03 rows=1,268 width=32) (actual time=0.411..94.968 rows=1,268,047 loops=539)

10. 88.540 1,814.159 ↓ 1,000.0 1,268,047 1

Nested Loop (cost=0.57..2,042,025.69 rows=1,268 width=32) (actual time=219.780..1,814.159 rows=1,268,047 loops=1)

11. 3.115 3.115 ↑ 1.0 7 1

Seq Scan on location farm (cost=0.00..466.17 rows=7 width=8) (actual time=2.246..3.115 rows=7 loops=1)

  • Filter: (id = ANY ('{72155209181364238,72155209181364235,72155209181364236,72155209181364237,72155209414344705,72155209181364234,72159268805738497}'::bigint[]))
  • Rows Removed by Filter: 11842
12. 1,722.504 1,722.504 ↓ 4.1 181,150 7

Index Scan using pest_measurement_start_time_project_index on pest_measurement pm (cost=0.57..291,213.26 rows=43,810 width=40) (actual time=32.164..246.072 rows=181,150 loops=7)

  • Index Cond: ((start_time >= '2019-04-08 00:00:00'::timestamp without time zone) AND (project_id = '72154491368833025'::bigint) AND (owner_loc_id = farm.id))
  • Filter: (plan_status = ANY ('{7,0,1,3}'::integer[]))
13. 0.052 0.084 ↑ 1.0 89 14

Materialize (cost=0.00..6.31 rows=89 width=8) (actual time=0.001..0.006 rows=89 loops=14)

14. 0.032 0.032 ↑ 1.0 89 1

Seq Scan on location_type plot_type (cost=0.00..5.86 rows=89 width=8) (actual time=0.010..0.032 rows=89 loops=1)

  • Filter: (main_type = ANY ('{12,3}'::integer[]))
  • Rows Removed by Filter: 60