explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Go4c

Settings
# exclusive inclusive rows x rows loops node
1. 171.612 2,489.311 ↓ 0.0 0 1

Insert on tmp_src_data (cost=922,518.02..1,096,084.37 rows=35,333 width=24) (actual time=2,489.311..2,489.311 rows=0 loops=1)

2. 464.767 2,317.699 ↓ 2.6 90,401 1

Merge Join (cost=922,518.02..1,095,731.04 rows=35,333 width=24) (actual time=48.817..2,317.699 rows=90,401 loops=1)

  • Merge Cond: ((vdc.device_id = d.device_id) AND (vdc.type_id = d.type_id) AND (vdc.nr = d.nr))
3.          

CTE d

4. 3.655 5.578 ↑ 1,664.5 3,110 1

Nested Loop (cost=0.00..64,784.07 rows=5,176,500 width=12) (actual time=0.262..5.578 rows=3,110 loops=1)

5. 1.923 1.923 ↑ 1.1 3,110 1

Seq Scan on tmp_device_list l (cost=0.00..49.70 rows=3,570 width=4) (actual time=0.173..1.923 rows=3,110 loops=1)

6. 0.000 0.000 ↑ 1,450.0 1 3,110

Materialize (cost=0.00..31.75 rows=1,450 width=8) (actual time=0.000..0.000 rows=1 loops=3,110)

7. 0.081 0.081 ↑ 1,450.0 1 1

Seq Scan on tmp_task_row tk (cost=0.00..24.50 rows=1,450 width=8) (actual time=0.079..0.081 rows=1 loops=1)

8. 1,825.072 1,825.072 ↓ 1.0 1,184,298 1

Index Scan using ix_device_data_cache_p1 on device_data_cache_1 vdc (cost=0.43..99,289.35 rows=1,181,935 width=32) (actual time=0.115..1,825.072 rows=1,184,298 loops=1)

9. 13.749 27.860 ↑ 57.3 90,381 1

Materialize (cost=857,733.52..883,616.02 rows=5,176,500 width=12) (actual time=11.572..27.860 rows=90,381 loops=1)

10. 5.813 14.111 ↑ 1,664.5 3,110 1

Sort (cost=857,733.52..870,674.77 rows=5,176,500 width=12) (actual time=11.564..14.111 rows=3,110 loops=1)

  • Sort Key: d.device_id, d.type_id, d.nr
  • Sort Method: quicksort Memory: 242kB
11. 8.298 8.298 ↑ 1,664.5 3,110 1

CTE Scan on d (cost=0.00..103,530.00 rows=5,176,500 width=12) (actual time=0.265..8.298 rows=3,110 loops=1)

Planning time : 0.776 ms
Execution time : 2,489.661 ms