Efficient security filter definitions for database data

I've got a security filter and I'm not sure if it fits the requirements to generate efficient SQL query to my cloud MySQL database.

Does IF statement qualify as a simple expression that gets calculated locally before querying the DB?

IF(USERSETTINGS(Zone) = 'Nigeria' , TRUE ,IN([SalesPersonEmail], SELECT(RTMMap[SalesPersonEmail], USERSETTINGS(Zone) = [Zone])))

The logic:

Select all the rows in Sales if the Zone on the mapping table is the same as the usersetting() zone. If it does not match any Zone return all the rows.

 

Jubilee_0-1662121912137.png

 

@Steve  , your the best ๐Ÿ˜‰ 

0 1 30
1 REPLY 1

Steve
Platinum 4
Platinum 4

@Jubilee wrote:

Does IF statement qualify as a simple expression that gets calculated locally before querying the DB?


Probably.

Top Labels in this Space