explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zLBC

Settings
# exclusive inclusive rows x rows loops node
1. 0.048 804.516 ↓ 2.6 1,000 1

Limit (cost=20,447.58..20,448.55 rows=389 width=182) (actual time=804.374..804.516 rows=1,000 loops=1)

2. 139.916 804.468 ↓ 2.6 1,000 1

Sort (cost=20,447.58..20,448.55 rows=389 width=182) (actual time=804.374..804.468 rows=1,000 loops=1)

  • Sort Key: data.data_time DESC
  • Sort Method: top-N heapsort Memory: 189kB
3. 72.369 664.552 ↓ 1,443.4 561,473 1

Nested Loop (cost=0.29..20,430.85 rows=389 width=182) (actual time=0.052..664.552 rows=561,473 loops=1)

  • Join Filter: (data.data_type_sur_id = t.data_type_sur_id)
4. 0.006 0.006 ↑ 1.0 1 1

Seq Scan on data_type t (cost=0.00..1.01 rows=1 width=19) (actual time=0.006..0.006 rows=1 loops=1)

  • Filter: (end_date > now())
5. 69.418 592.177 ↓ 1,443.4 561,473 1

Nested Loop (cost=0.29..20,424.97 rows=389 width=179) (actual time=0.045..592.177 rows=561,473 loops=1)

  • Join Filter: (data.data_model_sur_id = m.data_model_sur_id)
6. 0.003 0.003 ↑ 1.0 1 1

Seq Scan on data_model m (cost=0.00..1.01 rows=1 width=20) (actual time=0.002..0.003 rows=1 loops=1)

  • Filter: (end_date > now())
7. 69.655 522.756 ↓ 1,443.4 561,473 1

Nested Loop (cost=0.29..20,419.09 rows=389 width=175) (actual time=0.042..522.756 rows=561,473 loops=1)

  • Join Filter: (d.device_sur_id = data.device_sur_id)
8. 0.012 0.069 ↑ 1.0 1 1

Nested Loop (cost=0.29..10.46 rows=1 width=28) (actual time=0.022..0.069 rows=1 loops=1)

  • Join Filter: (d.device_sur_id = dc.device_sur_id)
  • Rows Removed by Join Filter: 99
9. 0.021 0.021 ↑ 1.0 1 1

Index Scan using device_id_unique on device d (cost=0.29..5.71 rows=1 width=20) (actual time=0.019..0.021 rows=1 loops=1)

  • Index Cond: (((device_id)::text = 'device_sguml'::text) AND (end_date > now()))
10. 0.036 0.036 ↑ 1.0 100 1

Seq Scan on device_configuration dc (cost=0.00..3.50 rows=100 width=8) (actual time=0.002..0.036 rows=100 loops=1)

  • Filter: (end_date > now())
11. 37.921 453.032 ↑ 1.1 561,473 1

Append (cost=0.00..12,899.96 rows=600,694 width=171) (actual time=0.018..453.032 rows=561,473 loops=1)

12. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on device_data data (cost=0.00..0.00 rows=1 width=171) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: (dc.device_sur_id = device_sur_id)
13. 166.088 166.088 ↓ 1.2 229,438 1

Index Scan using device_data_2019_08_device_sur_id_data_time_idx on device_data_2019_08 data_1 (cost=0.43..4,021.41 rows=186,819 width=171) (actual time=0.017..166.088 rows=229,438 loops=1)

  • Index Cond: (device_sur_id = dc.device_sur_id)
14. 249.016 249.016 ↑ 1.2 332,035 1

Index Scan using device_data_2019_09_device_sur_id_data_time_idx on device_data_2019_09 data_2 (cost=0.43..8,878.07 rows=413,872 width=171) (actual time=0.027..249.016 rows=332,035 loops=1)

  • Index Cond: (device_sur_id = dc.device_sur_id)
15. 0.007 0.007 ↓ 0.0 0 1

Index Scan using device_data_2019_10_device_sur_id_data_time_idx on device_data_2019_10 data_3 (cost=0.15..0.48 rows=2 width=171) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (device_sur_id = dc.device_sur_id)
Planning time : 1.209 ms
Execution time : 804.667 ms