有些行无法更新,有些可以

时间:2018-05-14 08:49:27

标签: postgresql

我们一直看到某些行的更新失败,而其他行也很好。有谁知道会导致这种行为的原因吗?

DATABASE=> UPDATE parcels SET notes=1 WHERE id=890300;
UPDATE 1
DATABASE=> UPDATE parcels SET notes=1 WHERE id=880300;
ERROR:  canceling statement due to statement timeout
CONTEXT:  while updating tuple (24447,44) in relation "parcels"

DATABASE=> EXPLAIN ANALYZE UPDATE parcels SET notes=1 WHERE id=890300;
                                                          QUERY PLAN                                                          
------------------------------------------------------------------------------------------------------------------------------
 Update on parcels  (cost=0.08..4.09 rows=1 width=312) (actual time=0.042..0.042 rows=0 loops=1)
   ->  Index Scan using parcels_pkey on parcels  (cost=0.08..4.09 rows=1 width=312) (actual time=0.013..0.015 rows=1 loops=1)
         Index Cond: (id = 890300)
 Planning time: 0.122 ms
 Execution time: 0.080 ms
(5 rows)

DATABASE=> EXPLAIN ANALYZE UPDATE parcels SET notes=1 WHERE id=880300;
ERROR:  canceling statement due to statement timeout
CONTEXT:  while updating tuple (24447,44) in relation "parcels"

0 个答案:

没有答案