explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2xIU

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 139.697 ↑ 1.0 1 1

Limit (cost=384.26..384.26 rows=1 width=16) (actual time=139.697..139.697 rows=1 loops=1)

2.          

CTE dublicate_users

3. 0.013 0.013 ↑ 85.0 4 1

Values Scan on "*VALUES*" (cost=0.00..4.25 rows=340 width=32) (actual time=0.003..0.013 rows=4 loops=1)

4.          

CTE upd

5. 107.739 139.406 ↑ 1.0 100 1

Update on motion t (cost=98.32..377.51 rows=100 width=2,469) (actual time=6.750..139.406 rows=100 loops=1)

6.          

CTE id_to_update

7. 0.049 4.293 ↑ 1.0 100 1

Limit (cost=0.56..97.76 rows=100 width=32) (actual time=3.250..4.293 rows=100 loops=1)

8. 0.077 4.244 ↑ 16,324.7 100 1

Nested Loop (cost=0.56..1,586,724.31 rows=1,632,472 width=32) (actual time=3.249..4.244 rows=100 loops=1)

9. 0.027 0.027 ↑ 85.0 4 1

CTE Scan on dublicate_users (cost=0.00..6.80 rows=340 width=32) (actual time=0.006..0.027 rows=4 loops=1)

10. 4.140 4.140 ↑ 192.0 25 4

Index Scan using i__motion__owner_id on motion t_upd (cost=0.56..4,618.81 rows=4,801 width=32) (actual time=0.802..1.035 rows=25 loops=4)

  • Index Cond: (owner_id = dublicate_users.dublicate_id)
  • Filter: (account_id = 'ed1d05b1-e159-11e6-7a69-971100001e4d'::uuid)
11. 0.231 31.667 ↑ 1.0 100 1

Nested Loop (cost=0.56..279.75 rows=100 width=2,469) (actual time=3.630..31.667 rows=100 loops=1)

12. 4.536 4.536 ↑ 1.0 100 1

CTE Scan on id_to_update (cost=0.00..2.00 rows=100 width=88) (actual time=3.266..4.536 rows=100 loops=1)

13. 26.900 26.900 ↑ 1.0 1 100

Index Scan using motion_pkey on motion t (cost=0.56..2.78 rows=1 width=2,397) (actual time=0.269..0.269 rows=1 loops=100)

  • Index Cond: (id = id_to_update.id)
14. 0.123 139.695 ↑ 100.0 1 1

Sort (cost=2.50..2.75 rows=100 width=16) (actual time=139.695..139.695 rows=1 loops=1)

  • Sort Key: upd.id DESC
  • Sort Method: top-N heapsort Memory: 25kB
15. 139.572 139.572 ↑ 1.0 100 1

CTE Scan on upd (cost=0.00..2.00 rows=100 width=16) (actual time=6.754..139.572 rows=100 loops=1)

Planning time : 2.181 ms
Execution time : 143.962 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
for constraint fk_motion_owner 3.978 ms 100 0.040 ms