creating exection plan of a given query