© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
12 replies
gonzalormonja

canceling statement due to statement timeout

I am getting timeout on a query but only after exceeding 400 records or so. I have a limit of 10 records per request and this query in a database manager is extremely fast but here I get timeout.
If I query before 400 records I get no error, could it be because of the amount of nesting I have? If I remove some of that nesting it is fixed, maybe supabase does not handle the join well?
I see that the relations of the keys are correctly configured, so it is not the problem.

In the supabase editor it works, returning about 10k rows without a problem in 8 seconds, while the limit of 10 takes about .5 seconds

export async function getInspectionBookings(
  client: Client,
  startIndex?: number
) {
  console.log(startIndex, startIndex! + 10)
  return client
    .from(table)
    .select(
      `
            *,
            property,
            object_form (
              formd (
                id,
                formt_id,
                sub_category(
                  sub_category_id,
                  category (
                    id
                  )
                )
              )
            ),
            clients{
              id
            ,
            workspace{
              id
            } 
            `,
      {
        count: "exact",
      }
    )
    .range(startIndex || 0, startIndex ? startIndex + 10 : 10)
  // .throwOnError()
}
export async function getInspectionBookings(
  client: Client,
  startIndex?: number
) {
  console.log(startIndex, startIndex! + 10)
  return client
    .from(table)
    .select(
      `
            *,
            property,
            object_form (
              formd (
                id,
                formt_id,
                sub_category(
                  sub_category_id,
                  category (
                    id
                  )
                )
              )
            ),
            clients{
              id
            ,
            workspace{
              id
            } 
            `,
      {
        count: "exact",
      }
    )
    .range(startIndex || 0, startIndex ? startIndex + 10 : 10)
  // .throwOnError()
}
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

canceling statement due to statement timeout
SupabaseSSupabase / help-and-questions
4y ago
debugging `canceling statement due to statement timeout` error
SupabaseSSupabase / help-and-questions
4y ago
cancelling statement due to statement timeout
SupabaseSSupabase / help-and-questions
8mo ago
Cancelling statement due to statemtn timeout
SupabaseSSupabase / help-and-questions
7mo ago