© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
dwome

Best Practice for Storage RLS

Hey,
I am currently wondering if there is any kind of best practices for indices when setting up rls for storage?

Status Quo:
Since the folder path is concatenated in the "name" property of the storage.objects table I do not see a way to setup an rls and indice where the DB just look at the first or second part of the name path in a performance efficient way.

Example:
folder path: <organisation_id>/<team_id>/file_name

We have an RLS Setup that checks if the user has access to the team_id

Now I would like to setup an indice so that a user can access the files of his team very efficient, as currently we are performing very week index scan, which are actually full table scans.

Is there any kind of example for RLS and indice setup available or any tip to setup a RLS on folder level with the corresponding indices?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Supabase Storage best practice
SupabaseSSupabase / help-and-questions
3y ago
Storage RLS Help
SupabaseSSupabase / help-and-questions
4mo ago
Best practice for implementing subdomain availability check with RLS in production
SupabaseSSupabase / help-and-questions
3mo ago
Best Practice for dev database
SupabaseSSupabase / help-and-questions
6mo ago