SLOW QUERIES
Hello, I'm from Brazil and I have a database hosted on Railway for a desktop application. I would like assistance to improve the query speed. Currently, I have the pro plan and the server is in Virginia.
24 Replies
Project ID:
6672a759-5b8b-46c8-be90-f607a400b533
6672a759-5b8b-46c8-be90-f607a400b533
@ocosta are you brazilian? if so, do you mind upvoting this community suggestion ? Bora trazer o Railway pro Brasil 😉
Also, what's the query latency? Can you be more specific on how much slow it is?
reqs from Brazil -> USA you can expect 150-200+ ms
Hello, I'm from Brazil
are you brazilian?
that is my copy paste text 💀
i know 🤣
So I'm probably doing something wrong, and yes, I am Brazilian.
It's just your DB that is hosted on railway? or it's also your API?
DB
What type? Postgres?
MySQL
its taking -+5s to do a query
ouch, you use an ORM or raw queries?
ORM, SQLAlchemy with PyQt6
I really don't know what could be slowing down your queries, I would blame SQLAlchemy 'cause railway doesn't seems like the culprit here.
And since you are on the pro plan, I don't think its a hardware or a network limitation
@ocosta 150ms might not seem much but for database is a lot, maybe it's better to have an API in the same region that your desktop application uses
had problems where my application was in the us-west region and the other on us-east, the latency went up about 1s
and also this feature request would help you a lot because it would be in Brazil the database
In MySQL Workbench, the latency is around 200ms, but in the application, it's more than 5s
I was using Prisma(nodejs orm) in mine and it had the same problem
puts
Switching from the ORM to the API, do you think it will improve?
100%
use some encoding like gzip in your API and it'll help a lot also
I'll test it this way, thnks
if you're using Prisma, try out accelerate
https://www.prisma.io/data-platform/accelerate
Prisma
Prisma Accelerate
Up to 1000x faster database queries with a global cache and scalable connection pool for serverless applications
I don't know if it works for your case, but it's worth a shot before building the API
cc @ocosta
thnks, i'll read about it
New reply sent from Help Station thread:
Cara, me da um help, fiquei um tempo de abrir o railway e no meu banco de dados não tem mais a opção de mandar queries, nem de editar as colunas...pra onde foram essas coisas?You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
tsemh, please use English as this is an English only community. Though I have translated the message - that functionality is gone, please use a proper database client like dbgateYou're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
Alright, thank you bro.You're seeing this because this thread has been automatically linked to the Help Station thread.