explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6pfA

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.674 ↑ 6.0 2 1

Append (cost=19.65..70.72 rows=12 width=965) (actual time=0.672..0.674 rows=2 loops=1)

2.          

Initplan (for Append)

3. 0.001 0.660 ↑ 1.0 1 1

Limit (cost=1.12..18.53 rows=1 width=8) (actual time=0.660..0.660 rows=1 loops=1)

4. 0.000 0.659 ↑ 287.0 1 1

Append (cost=1.12..4,998.84 rows=287 width=8) (actual time=0.659..0.659 rows=1 loops=1)

5. 0.659 0.659 ↑ 33.0 1 1

Index Scan using message_partition_2016_01_device_time_idx on message_partition_2016_01 m2_1 (cost=0.56..446.19 rows=33 width=8) (actual time=0.659..0.659 rows=1 loops=1)

  • Index Cond: ((device = 513) AND (""time"" < '2016-02-27 21:00:42.164+02'::timestamp with time zone))
  • Filter: ((message_type = 'STATUS'::text) OR (((json ->> 'direction'::text) = 'TO_SERVER'::text) AND ((json ->> 'media'::text) = 'SMS'::text)))
  • Rows Removed by Filter: 1
6. 0.000 0.000 ↓ 0.0 0

Index Scan using message_partition_1970_01_device_time_idx on message_partition_1970_01 m2 (cost=0.56..4,551.22 rows=254 width=8) (never executed)

  • Index Cond: ((device = 513) AND (""time"" < '2016-02-27 21:00:42.164+02'::timestamp with time zone))
  • Filter: ((message_type = 'STATUS'::text) OR (((json ->> 'direction'::text) = 'TO_SERVER'::text) AND ((json ->> 'media'::text) = 'SMS'::text)))
7. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using message_partition_1970_01_device_time_idx on message_partition_1970_01 m (cost=0.56..28.25 rows=7 width=985) (never executed)

  • Index Cond: ((device = 513) AND (""time"" < '2016-02-27 21:00:42.164+02'::timestamp with time zone) AND (""time"" >= $0))
8. 0.010 0.010 ↑ 2.5 2 1

Index Scan Backward using message_partition_2016_01_device_time_idx on message_partition_2016_01 m_1 (cost=0.56..23.88 rows=5 width=936) (actual time=0.008..0.010 rows=2 loops=1)

  • Index Cond: ((device = 513) AND (""time"" < '2016-02-27 21:00:42.164+02'::timestamp with time zone) AND (""time"" >= $0))
Planning time : 5.389 ms
Execution time : 0.792 ms