fix DB updating speed

Mentioned in  #512.

PS: had free time before evening.