WIP stats queries and tests