Sequelize sqlite query taking a long time.

I had a pretty simple select statement.  It was taking like a few ms when submitting in the sqlite3 command line utility.  Using Sequelize, it was taking 2.5 seconds.  I found that you can choose to use "raw" data, meaning you get Objects back that you can transform into JSON instead of getting "Models" back.  It can take some time to convert all of the records returned from the database into Models.

Here's the documentation on raw:

http://sequelizejs.com/documentation#models-finders - search for "Raw queries"

Since I started using raw for certain things, my performance has improved a lot!  Sweet!

Comments

Popular Posts