SLOW QUERIES

kelvin
PRO

a year ago

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.

Solved

3 Replies

kelvin
PRO

a year ago

6672a759-5b8b-46c8-be90-f607a400b533


a year ago

<@700335557925928970> are you brazilian? if so, do you mind upvoting this community suggestion ? Bora trazer o Railway pro Brasil 😉


a year ago

Also, what's the query latency? Can you be more specific on how much slow it is?


a year ago

reqs from Brazil -> USA you can expect 150-200+ ms


a year ago

Hello, I'm from Brazil

are you brazilian?


a year ago

that is my copy paste text 💀


a year ago

i know 🤣


kelvin
PRO

a year ago

So I'm probably doing something wrong, and yes, I am Brazilian.


a year ago

It's just your DB that is hosted on railway? or it's also your API?


kelvin
PRO

a year ago

DB


a year ago

What type? Postgres?


kelvin
PRO

a year ago

MySQL


kelvin
PRO

a year ago

its taking -+5s to do a query


a year ago

ouch, you use an ORM or raw queries?


kelvin
PRO

a year ago

ORM, SQLAlchemy with PyQt6


a year ago

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.


a year ago

And since you are on the pro plan, I don't think its a hardware or a network limitation


a year ago

<@700335557925928970> 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


Status changed to Solved Railway over 1 year ago


a year ago

had problems where my application was in the us-west region and the other on us-east, the latency went up about 1s


a year ago

and also this feature request would help you a lot because it would be in Brazil the database


kelvin
PRO

a year ago

In MySQL Workbench, the latency is around 200ms, but in the application, it's more than 5s


a year ago

I was using Prisma(nodejs orm) in mine and it had the same problem


kelvin
PRO

a year ago

puts


kelvin
PRO

a year ago

Switching from the ORM to the API, do you think it will improve?


a year ago

100%


a year ago

use some encoding like gzip in your API and it'll help a lot also


kelvin
PRO

a year ago

I'll test it this way, thnks


a year ago

if you're using Prisma, try out accelerate
https://www.prisma.io/data-platform/accelerate


a year ago

I don't know if it works for your case, but it's worth a shot before building the API


a year ago

cc <@700335557925928970>


kelvin
PRO

a year ago

thnks, i'll read about it


tsemh
HOBBY

a year ago

Guys, this question is kind of off topic but, I didn't open the railway for a long time and the option to send queries in the database disappeared…. What do I do now? Where did he go? I can't find it.


a year ago

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 dbgate


tsemh
HOBBY

a year ago

Alright, thank you bro.


SLOW QUERIES - Railway Help Station