4

I want to set bulk_insert_buffer_size variable for insert. I searched from other pages too, all they are saying about my.cnf. But there is no my.cnf in my system. I checked my.ini and there is no such variable there.

I also tried through command line -

SET GLOBAL bulk_insert_buffer_size= 268435456;

It shows -

1 queries executed, 1 success, 0 errors, 0 warnings
Query: SET GLOBAL bulk_insert_buffer_size =1024*1024*256
0 row(s) affected
Execution Time : 0 sec
Transfer Time : 0.001 sec
Total Time : 0.002 sec

but on running -

SHOW VARIABLES LIKE '%bulk%';

I am getting the same(old one) -

Variable_name Value 
bulk_insert_buffer_size 8388608 

Please let me know if I am doing something wrong. I am using Mysql 5.5 version.

Thank you.

RolandoMySQLDBA
185k34 gold badges327 silver badges541 bronze badges
asked Nov 30, 2013 at 13:53

1 Answer 1

6

When you ran

SET GLOBAL bulk_insert_buffer_size =1024*1024*256;

what you did was set the insert buffer to 256M for incoming DB Connections going forward.

To set it for your current DB session, run this in that session:

SET bulk_insert_buffer_size =1024*1024*256;

Then, you can run

SHOW VARIABLES LIKE '%bulk%';

and see a different value.

In a post made back on April 18, 2013 (see Steps 2 and 3), I suggested setting the bulk_insert_buffer_size to 256M within a current session.

If you want to keep that value when you restart mysql, just add this to my.cnf

[mysqld]
bulk_insert_buffer_size = 256M

Give it a Try !!!

answered Dec 1, 2013 at 0:37
2
  • these are for the myisam tables only not for innodb if i am not wrong here Commented Apr 8, 2020 at 4:27
  • 1
    @MuhammadOmerAslam you are correct. Please note that the question has a myisam tag. Commented Apr 8, 2020 at 14:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.