Executing query sketch