Log query count