right it's due to the fact that categories are eager fetched as they are needed most of the time, except when you select deviceTokens. So the fix is either to change this in the orm.xml or like I've done now add a distinct on the deviceToken query