Implement top k highest volume leaf categories in SQL