mysql - What is the best way to insert million record in sequelize -


what best way insert million record using sequelize, using bulkcreate it's slow , didn't finish.

so think there's way it.

return dbmytable.bulkcreate(array, {transaction: t}).then(function (item) {        return res.jsonp('done'); }) 

i ran same issue using postgresql , agree @e4c5 built-in database method best this. problem you're loading data memory until bulkcreate executes. if got million rows, you'll run out of memory before executes. still, if queue using async.cargo, you'll still waiting db while data asyncrhonously consumes memory.

my solution ditch sequelize loading of data (at least until implement streaming or (see github issue #2454)). ended creating db-streamer, has pg support now. you'll want @ streamsql mysql.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -