Stefano Bonicatti
12/13/2021, 8:08 PMgid. The problem is that gid is not really used for filtering on Windows API's. We still retrieve it as the RID of the SID representing the group, and that gid is present on both users and groups tables.
The problem comes though when you do a JOIN between users and groups. For each user you have, the groups table has to return all the groups everytime, this is because gid cannot be used for filtering.
The groups table has a group_sid column which could be used for filtering (needs to be implemented), but it's missing in the users table. Now suppose that we were going to implement such filtering, now all the queries that want to join users and groups on Windows only, should change and use that other column.
The alternative is that we should use a more generic column name, just group_id and on POSIX platforms that's the gid, but on Windows that's the sid.
Obviously that partially hides what that column really is but permits to do a bit more generic queries.