table flags and resolving in db