Database Discussion MongoDB

SQL query performance enhancement

We know that model querying take more time than raw sql querying.

Here is some practice with sample test.
In sails.js project, we use waterline ORM by default. It’s Node.js ORM but we can bind SQL dbs like MySQL, PostgreSQL. When we tried to execute query using model, it took around 2 seconds to retrieve around 6000 rows.

But when we tried the same query using raw sql query it took around 10ms.
In stackoverflow, there is another example – model querying took 12000ms and raw sql querying took less than 1ms.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *