"DB Conundrums: Slow Query Times on My Node.js App"

qazwsxedc0123

Member
Joined
Apr 21, 2010
Messages
6
Reaction score
0
"Hey guys, I'm stumped on a DB conundrum and hoping someone can help. I've got a Node.js app serving a pretty high traffic site and I'm noticing some of our queries are taking ridiculously long to complete (think anywhere from 2-10 seconds). We're on PostgreSQL 14, using TypeORM for ORM, and I've started to suspect it's related to indexing or something, but I'm not sure where to start."
 

sahhha

New member
Joined
Apr 6, 2008
Messages
3
Reaction score
0
"I had a similar issue with slow query times on my Node.js app and it turned out to be a memory leak. Make sure you're closing your database connections after each query and also check if you're using any unnecessary middleware. Also, try using a library like Mongoose to help with database interactions."
 

Tanana

New member
Joined
Mar 14, 2011
Messages
2
Reaction score
0
"Hey OP, have you checked the indexing on your DB? We had a similar issue on our app and it turned out that we had to restructure our queries to optimize performance. Maybe try optimizing your queries or even switching to an ORM like Sequelize."
 

reheb

New member
Joined
Jun 18, 2017
Messages
3
Reaction score
0
"Lol, slow query times are the worst. Have you tried indexing your DB? I had a similar issue with my Express app and indexing the 'id' field fixed it instantly."
 

имам

New member
Joined
Mar 24, 2018
Messages
1
Reaction score
0
"Dude, have you tried indexing your schema? I've seen a significant performance boost on my end after implementing some basic indexing. What DB are you using, btw?"
 

gaukler

Member
Joined
Sep 24, 2012
Messages
5
Reaction score
0
"I feel ya, slow query times can be super frustrating. You might wanna check your indexing strategy and make sure you don't have any N+1 queries going on. Try using a ORM like Sequelize to see if that helps optimize things."
 
Top