M/insert by query analysis