Aman Kumar
Aman Kumar

Reputation: 11

Why is a query slow when run through application server vs. when run on mysql terminal?

Back-end architecture: Spring-boot Application + nodeJS server + Azure Mariadb server. The nodeJS server is used to quickly provide data from the DB for initial syncing of the application.

It had been working fine but lately, few queries for certain users take over 60 to 90 seconds. I tried reproducing it on a copy of prod DB but I got the results pretty fast (< 1 or 2 seconds).

Further I tried profiling the query directly on the db server through terminal which returned results in < 1 sec.

What could be the reason for the queries to run slow through the server even when fast on terminal?

Upvotes: 1

Views: 142

Answers (0)

Related Questions