Supabase Storage: can/should I add indexes to speed up .list()?

I’m using these functions to list files from Supabase Storage, but the calls are quite slow.

Questions:
Is it safe (or even possible) to add indexes to improve performance?
If yes, exactly where should the index be added?
const productImagesQuery = (shopId: string) => supabase
    .storage
    .from('public_uploads')
    .list(`${shopId}/products`, {
        limit: 1000,
    });

const logoImageQuery = (shopId: string, branchId: number) => supabase
    .storage
    .from('public_uploads')
    .list(`${shopId}/logo`, {
        limit: 1,
        search: String(branchId),
    });

const bannerImageQuery = (shopId: string, branchId: number) => supabase
    .storage
    .from('public_uploads')
    .list(`${shopId}/banner`, {
        limit: 1,
        search: String(branchId),
    });
image.png
Was this page helpful?