db functions redo