update t_tmp set win = win + 1, date_win = (selectCASEdate(date_win_modify_time) WHENCURRENT_DATETHEN date_win + 1 ELSE 1 END from t_tmp where appid = $1 and skyid = $2), week_win = (selectCASE date_trunc('week', week_win_modify_time) WHEN date_trunc('week', now()) THEN week_win + 1 ELSE 1 END from t_tmp where appid = $3 and skyid = $4), date_win_modify_time = now(), week_win_modify_time = now(), strength_value = strength_value + $5 WHERE appid = $6 and skyid = $7
备注: 这个语句是 update 语句,更新非常频繁,且业务逻辑复杂。
报错代码含义
What does the above mean? It means you have got a corrupted index. REINDEX will probably fix it. You should try to figure out what caused the problem though …
备注:说是索引被损坏,需要重建索引。
查询异常索引信息
1 2 3 4 5 6 7 8 9 10 11 12 13
skytf=> /dt+ t_tmp List of relations Schema | Name | Type | Owner | Size | Description --------+-------------+-------+-------+---------+------------- skytf | t_tmp | table | skytf | 2207 MB | 角色信息表 (1 row)
skytf=> /di+ t_tmp_win_date_win_modify_time_idx List of relations Schema | Name | Type | Owner | Table | Size | Description --------+------------------------------------------+-------+-------+-------------+---------+------------- skytf | t_tmp_win_date_win_modify_time_idx | index | skytf | t_tmp | 1016 MB | (1 row)