explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W4gA

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 3,741.759 ↑ 2.0 1 1

Nested Loop (cost=0.85..347.06 rows=2 width=82) (actual time=3,740.035..3,741.759 rows=1 loops=1)

2. 0.063 0.063 ↑ 1.0 2 1

Index Only Scan using hardware_controller_pkey on hardware_controller hc (cost=0.29..12.61 rows=2 width=4) (actual time=0.020..0.063 rows=2 loops=1)

  • Index Cond: (id = ANY ('{3551,4096}'::integer[]))
  • Heap Fetches: 2
3. 0.022 3,741.684 ↓ 0.0 0 2

Subquery Scan on q1 (cost=0.56..167.22 rows=1 width=78) (actual time=1,870.841..1,870.842 rows=0 loops=2)

  • Filter: ((q1.next_payload IS NULL) AND (((q1.payload)::text = '1,SLT_SLEEP,SLR_OTA_OS_FIRMWARE_UPDATE,Restarting in Particle Cloud mode'::text) OR ((q1.payload)::text = '1,SLT_SLEEP,SLR_UNKNOWN,Probably the reset button or DFU mode firmware up'::text)))
  • Rows Removed by Filter: 0
4. 0.006 3,741.662 ↑ 1.0 1 2

Limit (cost=0.56..167.20 rows=1 width=82) (actual time=1,870.831..1,870.831 rows=1 loops=2)

5. 0.020 3,741.656 ↑ 2,314.0 1 2

WindowAgg (cost=0.56..385,596.76 rows=2,314 width=82) (actual time=1,870.828..1,870.828 rows=1 loops=2)

6. 3,741.636 3,741.636 ↑ 2,314.0 1 2

Index Scan Backward using controller_event_log_published_at_idx on controller_event_log (cost=0.56..385,562.05 rows=2,314 width=46) (actual time=1,870.818..1,870.818 rows=1 loops=2)

  • Index Cond: (published_at > '2018-12-18 01:00:00+01'::timestamp with time zone)
  • Filter: (controller_id = hc.id)
  • Rows Removed by Filter: 2560948