implemented insert-by-query plan

global aggregations + index writer, could be maybe only a planner test