I am using Sequelize v6.23.0 in my Node.js (v16.x) project.
The query executions are taking very long. So, I did a quick comparison between Sequelize and MySQL2 library. The execution time difference was very significant. MySQL2 seems faster. Is it expected ? Or do we need to tune any configurations ?
Comparison Results:
SELECT Query:
Sequelize: 23.29845 ms
MySQL2: 2.010144 ms
UPDATE Query:
Sequelize: 27.175449 ms
MySQL2: 5.979536 ms
INSERT Query:
Sequelize: 31.414926 ms
MySQL2: 7.720711 ms
Note: For now, I am just executing raw queries in both Sequelize and MySQL2. Please help me out on this issue !
Dinesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.