explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vMQb

Settings

Optimization(s) for this plan:

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

Nested Loop Left Join (cost=0.57..1,473.62 rows=1 width=12) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.29..1,465.30 rows=1 width=108) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Seq Scan on monitoring_monitoring (cost=0.00..3.26 rows=1 width=4) (actual rows= loops=)

  • Filter: (station_id = 113)
4. 0.000 0.000 ↓ 0.0

Index Scan using monitoring_alarm_monitoring_id_a3b784d4 on monitoring_alarm (cost=0.29..1,462.03 rows=1 width=112) (actual rows= loops=)

  • Index Cond: (monitoring_id = monitoring_monitoring.id)
  • Filter: (((data ->> 'check_type'::text) = 'production'::text) AND ((data ->> 'key'::text) = ANY ('{i,i1,i2,i3,i4,i5,i6}'::text[])) AND CASE WHEN (state = 0) THEN (('2019-09-21 14:30:00+03'::timestamp with time zone >= opened_at) AND ('2019-09-21 14:30:00+03'::timestamp with time zone <= closed_at)) WHEN (state = 1) THEN ('2019-09-21 14:30:00+03'::timestamp with time zone >= opened_at) ELSE NULL::boolean END)
5. 0.000 0.000 ↓ 0.0

Index Scan using solarify_device_pkey on solarify_device (cost=0.28..8.30 rows=1 width=52) (actual rows= loops=)

  • Index Cond: (monitoring_alarm.object_id = id)