»Ë»Ñ Æ÷·³
IT °³¹ßÀÚ°£ Á¤º¸¸¦ °øÀ¯ÇÏ°í ³íÀÇ°¡ ÀÌ·ç¾îÁö´Â °ø°£ÀÔ´Ï´Ù.

java executeLargeBatch ó¸® ÇÒ¶§ ½Ã°£ Áö¿¬ Çö»ó2

  • ÆÇÆÁÆÄÀÚ
  • µî·ÏÀÏ 2022-01-28 09:56
  • Á¶È¸¼ö 832


                mssqlInsertStatement.addBatch();

                

                count ++;

                

                if(count % 10000 == 0) {

                mssqlInsertStatement.executeLargeBatch();

                mssqlInsertStatement.clearBatch();

               

                mssqlConnection.commit();

               

                1, 2 > log.debug("batch commit taken = " + count );

                }

            }

            

            mssqlInsertStatement.executeLargeBatch();

            mssqlInsertStatement.clearBatch();

            

            3> log.debug(" ¡Ú batch insert total = " + count);

 

 

 

1> 2022-01-28 09:24:22 [main] [DEBUG] BatchForBilldata(writeWithCompileQueryInsert:351) -> batch commit taken = 340000

2> 2022-01-28 09:24:37 [main] [DEBUG] BatchForBilldata(writeWithCompileQueryInsert:351) -> batch commit taken = 350000

3> 2022-01-28 09:27:29 [main] [DEBUG] BatchForBilldata(writeWithCompileQueryInsert:360) ->  ¡Ú batch insert total = 357755

 

ÀÚ¹Ù·Î batch ó¸® ÁßÀε¥ 1¹ø°ú 2¹ø »çÀÌ ½Ã°£Àº °ÅÀÇ Å« Â÷ÀÌ°¡ ¾ø´Âµ¥ resultset.next()¸¦ ºüÁ® ³ª¿À¸é¼­ 2ºÐ Á¤µµ µô·¹ÀÌ°¡ »ý±â´Âµ¥

 

¿øÀÎÀ» ¸ð¸£°Ú¾î¿ä. 

 

Å« ½Ã°£Àº ¾Æ´Ñµ¥ 30¸¸°Ç¾¿ Àüü 800¸¸°ÇÀ» µ¹·Á¾ß Çؼ­ ¼Óµµ°¡ Áß¿äÇÑ ºÎºÐÀ̶ó ±Ã±ÝÇÕ´Ï´Ù.

 

 

 

 

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
ºÏ¸¶Å©¹öÆ° °øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 Áø·Î³ª¶ó
2022-01-28 Á¡¾ÆÀÌÄÜ
  1. ´ñ±ÛÁÖ¼Òº¹»ç

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ÆÇÆÁÆÄÀÚ
2022-01-29 Á¡¾ÆÀÌÄÜ
  1. ´ñ±ÛÁÖ¼Òº¹»ç
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û -¸ñ·Ïº¸±â