Reputation: 990
I'm working with Azure SQL Server (2019) and need to design an efficient way to filter entities based on user permissions.
Bitwise Representation:
areaBits
for each entity.entities.areaBits & userExposedAreaBits = entities.areaBits
.Join with Relationship Table (EntityAreas
):
(EntityId, AreaId)
pairs in a mapping table.What is the best way to model and implement the main query to efficiently filter entities while ensuring a good execution plan? Looking for a solution that scales well with large datasets.
Upvotes: 0
Views: 44