explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kPSP

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 27.753 ↑ 10.0 1 1

Update on controls_backup (cost=1.02..25.80 rows=10 width=566) (actual time=27.665..27.753 rows=1 loops=1)

  • Update on controls_backup
  • Update on controls_backup_migration_0
  • Update on controls_backup_migration_1
  • Update on controls_backup_migration_2
  • Update on controls_backup_migration_3
  • Update on controls_backup_migration_4
  • Update on controls_backup_migration_5
  • Update on controls_backup_migration_6
  • Update on controls_backup_migration_7
  • Update on controls_backup_migration_8
2.          

Initplan (for Update)

3. 0.006 26.593 ↑ 1.0 1 1

Limit (cost=0.38..0.60 rows=1 width=24) (actual time=26.588..26.593 rows=1 loops=1)

4. 0.010 26.587 ↑ 441,656.0 1 1

LockRows (cost=0.38..98,865.48 rows=441,656 width=24) (actual time=26.587..26.587 rows=1 loops=1)

5. 0.005 26.577 ↑ 441,656.0 1 1

Nested Loop Anti Join (cost=0.38..94,448.92 rows=441,656 width=24) (actual time=26.577..26.577 rows=1 loops=1)

  • Join Filter: (p.control_id = c.id)
  • Rows Removed by Join Filter: 1
6. 0.003 26.478 ↑ 883,311.0 1 1

Append (cost=0.00..81,196.67 rows=883,311 width=18) (actual time=26.478..26.478 rows=1 loops=1)

7. 26.464 26.464 ↓ 0.0 0 1

Seq Scan on controls_backup c (cost=0.00..38,412.09 rows=441,909 width=18) (actual time=26.464..26.464 rows=0 loops=1)

8. 0.011 0.011 ↑ 4,719.0 1 1

Seq Scan on controls_backup_migration_0 c_1 (cost=0.00..410.19 rows=4,719 width=18) (actual time=0.011..0.011 rows=1 loops=1)

9. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_1 c_2 (cost=0.00..5,308.74 rows=61,074 width=18) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_2 c_3 (cost=0.00..5,329.08 rows=61,308 width=18) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_3 c_4 (cost=0.00..5,551.69 rows=63,869 width=18) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_4 c_5 (cost=0.00..4,952.79 rows=56,979 width=18) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_5 c_6 (cost=0.00..5,188.96 rows=59,696 width=18) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_6 c_7 (cost=0.00..4,860.13 rows=55,913 width=18) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_7 c_8 (cost=0.00..4,817.19 rows=55,419 width=18) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Seq Scan on controls_backup_migration_8 c_9 (cost=0.00..1,949.25 rows=22,425 width=18) (never executed)

17. 0.004 0.094 ↑ 1.0 1 1

Materialize (cost=0.38..2.59 rows=1 width=14) (actual time=0.031..0.094 rows=1 loops=1)

18. 0.090 0.090 ↑ 1.0 1 1

Index Scan using processes_control_id_unique on processes p (cost=0.38..2.59 rows=1 width=14) (actual time=0.027..0.090 rows=1 loops=1)

19. 26.605 26.605 ↓ 0.0 0 1

Index Scan using controls_backup_pkey on controls_backup (cost=0.42..2.64 rows=1 width=566) (actual time=26.605..26.605 rows=0 loops=1)

  • Index Cond: (id = $2)
20. 0.013 0.013 ↑ 1.0 1 1

Index Scan using controls_backup_migration_0_pkey on controls_backup_migration_0 (cost=0.28..2.50 rows=1 width=566) (actual time=0.011..0.013 rows=1 loops=1)

  • Index Cond: (id = $2)
21. 0.007 0.007 ↓ 0.0 0 1

Index Scan using controls_backup_migration_1_pkey on controls_backup_migration_1 (cost=0.29..2.51 rows=1 width=566) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (id = $2)
22. 0.006 0.006 ↓ 0.0 0 1

Index Scan using controls_backup_migration_2_pkey on controls_backup_migration_2 (cost=0.29..2.51 rows=1 width=566) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (id = $2)
23. 0.005 0.005 ↓ 0.0 0 1

Index Scan using controls_backup_migration_3_pkey on controls_backup_migration_3 (cost=0.29..2.51 rows=1 width=566) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (id = $2)
24. 0.036 0.036 ↓ 0.0 0 1

Index Scan using controls_backup_migration_4_pkey on controls_backup_migration_4 (cost=0.29..2.51 rows=1 width=566) (actual time=0.035..0.036 rows=0 loops=1)

  • Index Cond: (id = $2)
25. 0.011 0.011 ↓ 0.0 0 1

Index Scan using controls_backup_migration_5_pkey on controls_backup_migration_5 (cost=0.29..2.51 rows=1 width=566) (actual time=0.011..0.011 rows=0 loops=1)

  • Index Cond: (id = $2)
26. 0.006 0.006 ↓ 0.0 0 1

Index Scan using controls_backup_migration_6_pkey on controls_backup_migration_6 (cost=0.29..2.51 rows=1 width=566) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (id = $2)
27. 0.005 0.005 ↓ 0.0 0 1

Index Scan using controls_backup_migration_7_pkey on controls_backup_migration_7 (cost=0.29..2.51 rows=1 width=566) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (id = $2)
28. 0.006 0.006 ↓ 0.0 0 1

Index Scan using controls_backup_migration_8_pkey on controls_backup_migration_8 (cost=0.29..2.51 rows=1 width=566) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (id = $2)
Planning time : 2.901 ms
Execution time : 28.246 ms