improve SQL robustness for repetitive run during hoanoho-update