Sandboxing, user attributes, large database issues

Here is what I am trying to accomplish

Database has data from multiple different retail locations. This should be the flow

user logs in -> query run to see what stores user has access to -> dashboard only displays and gives access to his locations

my question is if i run a query in sandboxed mode does it apply the sandboxed filters before running the query or after. if its after performance will be very bad. Am I able to use user attributes within SQL queries instead?

If you're using the paid version of the product, you can contact us at help at metabase dot com