Batching of queries for action logging