Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda