This has nothing to do with security. It's just wasted CPU. I imagine you have to do this every time you make a query to lookup the users DB?
Security is not a concern here. It's just literally bucketing ids. Also, this is not needed with modern file systems.