Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

209
Vistas
mysql batch insertion - large number of records

I am trying to insert multiple records to MySQL table in single go.

FYI: My tech stack is Nodejs+MySQL (https://www.npmjs.com/package/mysql)

What I am currently doing is:

INSERT INTO table_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);

The problem with my above solution is that when I have around 50k records, the MySQL buffer explodes.

For that I changed

max_allowed_packet = 1000MB

But I am sure that is not a proper solution. I am looking for the best & optimized workaround possible in this scenario.

Any clues or hints would be highly appreciated. Thanks

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

For many reasons (you encountered one of them), I break up batch inserts into clumps of 100 or 1000 rows at a time. That will be within 1% of the same speed, while avoiding lots of problems.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda