allocation: update sql for accuracy