simplified statistics query to make it faster