Move <warnings> and <query-continue> to result's top and optimize