Seeing slow 50ms queries for simple select * of a 2000 record query to a Supabase database.

sergiotapia
HOBBY

9 months ago

Example of a query that takes 54ms:

SELECT u0."id", u0."phoneNumber", u0."timezone", u0."createdAt" FROM "users" AS u0 WHERE (u0."phoneNumber" = $1)

Normally when I host an app in Railway, the app and database are in the same geo and hosted by the same PaaS. I see much faster response times for much beefier queries and table sizes.

So what's going on - why is Supabase so slow?

  • My app is currently hosted in Railway, US West (Oregon, USA)

  • My Supabase "app" (the database) is hosted in "West US (North California) - AWS t4g.small

  • I'm connect to Postgres using the ipv4 addon, and using the non pooler connection string url.

Is this just the expected latency?

0 Replies

sergiotapia
HOBBY

9 months ago

ac62f702-07b5-4319-85e4-aab729599d4a


9 months ago

Is this just the expected latency?
Unfortunately, yes, supabase is famous for its latency unless you also host in the same zone


sergiotapia
HOBBY

9 months ago

christ on a cracker - I inherited this project. now i cry


9 months ago

if only supabase could be ran on railway


sergiotapia
HOBBY

9 months ago

I will rip out supabase when the time is right. we should only be using these dudes for the auth I guess.


sergiotapia
HOBBY

9 months ago

get my pg on railway ASAP


9 months ago

love that attitude! supabase is just abstraction on top of abstraction after all


Seeing slow 50ms queries for simple select * of a 2000 record query to a Supabase database. - Railway Help Station