db query change