explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gilP

Settings
# exclusive inclusive rows x rows loops node
1. 203.311 1,740.610 ↓ 1.0 287,445 1

Sort (cost=93,568.44..94,262.50 rows=277,626 width=126) (actual time=1,701.775..1,740.610 rows=287,445 loops=1)

  • Sort Key: d.detected_timestamp
  • Sort Method: external merge Disk: 29240kB
2. 1,394.658 1,537.299 ↓ 1.0 287,445 1

Hash Right Join (cost=7,200.01..50,435.18 rows=277,626 width=126) (actual time=185.290..1,537.299 rows=287,445 loops=1)

  • Hash Cond: (tbl.sensor_id = s.sensor_id)
  • Join Filter: ((d.detected_timestamp >= tbl.effective_start) AND (d.detected_timestamp <= tbl.effective_end))
  • Rows Removed by Join Filter: 13694538
3. 2.678 2.678 ↑ 1.3 288 1

Seq Scan on tirtl_beam_levels tbl (cost=0.00..1,182.20 rows=365 width=36) (actual time=0.006..2.678 rows=288 loops=1)

  • Filter: ((effective_start < '2019-01-02 00:00:00+10'::timestamp with time zone) AND (effective_end > '2019-01-01 00:00:00+10'::timestamp with time zone))
  • Rows Removed by Filter: 36592
4. 73.710 139.963 ↓ 6.0 287,445 1

Hash (cost=5,852.02..5,852.02 rows=47,919 width=98) (actual time=139.963..139.963 rows=287,445 loops=1)

  • Buckets: 32768 (originally 32768) Batches: 4 (originally 2) Memory Usage: 23212kB
5. 26.196 66.253 ↓ 6.0 287,445 1

Nested Loop (cost=1,372.80..5,852.02 rows=47,919 width=98) (actual time=3.081..66.253 rows=287,445 loops=1)

6. 0.026 0.087 ↓ 5.0 5 1

Nested Loop (cost=0.13..14.46 rows=1 width=4) (actual time=0.038..0.087 rows=5 loops=1)

7. 0.009 0.046 ↓ 5.0 5 1

Nested Loop (cost=0.13..13.42 rows=1 width=8) (actual time=0.032..0.046 rows=5 loops=1)

  • Join Filter: (s.location_id = l.location_id)
  • Rows Removed by Join Filter: 21
8. 0.022 0.022 ↓ 2.1 15 1

Index Scan using "PK_sensors" on sensors s (cost=0.13..12.24 rows=7 width=8) (actual time=0.014..0.022 rows=15 loops=1)

9. 0.006 0.015 ↓ 2.0 2 15

Materialize (cost=0.00..1.08 rows=1 width=8) (actual time=0.001..0.001 rows=2 loops=15)

10. 0.009 0.009 ↓ 2.0 2 1

Seq Scan on locations l (cost=0.00..1.08 rows=1 width=8) (actual time=0.009..0.009 rows=2 loops=1)

  • Filter: (route_id = 5)
  • Rows Removed by Filter: 13
11. 0.015 0.015 ↑ 1.0 1 5

Seq Scan on routes r (cost=0.00..1.02 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=5)

  • Filter: (route_id = 5)
  • Rows Removed by Filter: 5
12. 31.160 39.970 ↑ 1.7 57,489 5

Bitmap Heap Scan on detections d (cost=1,372.67..4,879.19 rows=95,838 width=94) (actual time=1.838..7.994 rows=57,489 loops=5)

  • Recheck Cond: (sensor_id = s.sensor_id)
  • Filter: ((detected_timestamp >= '2019-01-01 00:00:00+10'::timestamp with time zone) AND (detected_timestamp <= '2019-01-02 00:00:00+10'::timestamp with time zone))
  • Rows Removed by Filter: 2511
  • Heap Blocks: exact=4288
13. 8.810 8.810 ↑ 1.7 60,000 5

Bitmap Index Scan on "IXFK_detections_sensors" (cost=0.00..1,348.71 rows=100,000 width=0) (actual time=1.762..1.762 rows=60,000 loops=5)

  • Index Cond: (sensor_id = s.sensor_id)
Planning time : 0.614 ms
Execution time : 1,751.532 ms