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

Example of a query that takes 54ms:
SELECT u0."id", u0."phoneNumber", u0."timezone", u0."createdAt" FROM "users" AS u0 WHERE (u0."phoneNumber" = $1)
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?
Solution:
Is this just the expected latency?
Unfortunately, yes, supabase is famous for its latency unless you also host in the same zone...
Jump to solution
7 Replies
Percy
Percy2mo ago
Project ID: ac62f702-07b5-4319-85e4-aab729599d4a
slymilano
slymilanoOP2mo ago
ac62f702-07b5-4319-85e4-aab729599d4a
Solution
Brody
Brody2mo ago
Is this just the expected latency?
Unfortunately, yes, supabase is famous for its latency unless you also host in the same zone
slymilano
slymilanoOP2mo ago
christ on a cracker - I inherited this project. now i cry
Brody
Brody2mo ago
if only supabase could be ran on railway
slymilano
slymilanoOP2mo ago
I will rip out supabase when the time is right. we should only be using these dudes for the auth I guess. get my pg on railway ASAP
Brody
Brody2mo ago
love that attitude! supabase is just abstraction on top of abstraction after all
Want results from more Discord servers?
Add your server