I'm running the same query (in the same database) on nodejs (npm/package/mysql) and mysql workbench and the execution time is absurdly different.
Follows the execution duration data:
- nodejs: 22468.275ms (22,5 seconds)
- mysql workbench: duration 0,019 sec / fetch 0,147 sec
db.config
{ "connectionLimit" : 10, "host" : "localhost", "user" : "root", "password" : "root", "database" : "db" }
other information:
- the mysql is running within a docker
- the main table of query has 9.500.000 records
- has a join with another large table with 1.500.000 records
- the query results are 150000 records
what is the reason for this difference?