add query allocation and `begin' of query execution