partially fixed query implementation