explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2EKj

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 19.070 94.473 ↑ 3.4 11,106 1

Hash Join (cost=426.88..4,739.08 rows=38,256 width=40) (actual time=14.032..94.473 rows=11,106 loops=1)

  • Output: dev.id, dev.org_id, dev.device_id, dev.serial_number, dev.type_id, dh.history_dtt
  • Inner Unique: true
  • Hash Cond: (dh.device_id = dev.id)
  • Buffers: shared hit=2,671
2. 9.408 61.400 ↓ 1.0 38,313 1

Append (cost=0.00..4,211.74 rows=38,256 width=16) (actual time=0.011..61.400 rows=38,313 loops=1)

  • Buffers: shared hit=2,494
3. 0.049 0.049 ↓ 3.0 3 1

Seq Scan on users.device_history_p2020_02 dh (cost=0.00..1.04 rows=1 width=16) (actual time=0.010..0.049 rows=3 loops=1)

  • Output: dh.history_dtt, dh.device_id
  • Filter: ((dh.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh.device_event_type)::text = 'ADDITION'::text))
  • Buffers: shared hit=1
4. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on users.device_history_p2020_03 dh_1 (cost=0.00..1.01 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: dh_1.history_dtt, dh_1.device_id
  • Filter: ((dh_1.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh_1.device_event_type)::text = 'ADDITION'::text))
  • Buffers: shared hit=1
5. 0.005 0.005 ↓ 2.0 2 1

Seq Scan on users.device_history_p2020_04 dh_2 (cost=0.00..1.03 rows=1 width=16) (actual time=0.004..0.005 rows=2 loops=1)

  • Output: dh_2.history_dtt, dh_2.device_id
  • Filter: ((dh_2.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh_2.device_event_type)::text = 'ADDITION'::text))
  • Buffers: shared hit=1
6. 47.476 47.476 ↓ 1.0 33,271 1

Seq Scan on users.device_history_p2020_05 dh_3 (cost=0.00..3,750.56 rows=33,216 width=16) (actual time=0.007..47.476 rows=33,271 loops=1)

  • Output: dh_3.history_dtt, dh_3.device_id
  • Filter: ((dh_3.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh_3.device_event_type)::text = 'ADDITION'::text))
  • Rows Removed by Filter: 61,433
  • Buffers: shared hit=2,330
7. 0.409 0.409 ↑ 1.0 8 1

Seq Scan on users.device_history_p2020_06 dh_4 (cost=0.00..48.24 rows=8 width=16) (actual time=0.010..0.409 rows=8 loops=1)

  • Output: dh_4.history_dtt, dh_4.device_id
  • Filter: ((dh_4.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh_4.device_event_type)::text = 'ADDITION'::text))
  • Rows Removed by Filter: 1,008
  • Buffers: shared hit=33
8. 0.379 0.379 ↓ 0.0 0 1

Seq Scan on users.device_history_p2020_07 dh_5 (cost=0.00..46.15 rows=1 width=16) (actual time=0.379..0.379 rows=0 loops=1)

  • Output: dh_5.history_dtt, dh_5.device_id
  • Filter: ((dh_5.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh_5.device_event_type)::text = 'ADDITION'::text))
  • Rows Removed by Filter: 1,010
  • Buffers: shared hit=31
9. 3.668 3.668 ↑ 1.0 5,028 1

Seq Scan on users.device_history_default dh_6 (cost=0.00..172.42 rows=5,028 width=16) (actual time=0.019..3.668 rows=5,028 loops=1)

  • Output: dh_6.history_dtt, dh_6.device_id
  • Filter: ((dh_6.history_dtt < '2020-08-01 00:00:00'::timestamp without time zone) AND ((dh_6.device_event_type)::text = 'ADDITION'::text))
  • Buffers: shared hit=97
10. 7.157 14.003 ↑ 1.0 11,106 1

Hash (cost=288.06..288.06 rows=11,106 width=32) (actual time=14.002..14.003 rows=11,106 loops=1)

  • Output: dev.id, dev.org_id, dev.device_id, dev.serial_number, dev.type_id
  • Buckets: 16,384 Batches: 1 Memory Usage: 803kB
  • Buffers: shared hit=177
11. 6.846 6.846 ↑ 1.0 11,106 1

Seq Scan on users.device dev (cost=0.00..288.06 rows=11,106 width=32) (actual time=0.007..6.846 rows=11,106 loops=1)

  • Output: dev.id, dev.org_id, dev.device_id, dev.serial_number, dev.type_id
  • Buffers: shared hit=177