Planning db functions