mysql - Executing multiple insert queries -


i insert 365 insert records, want know better.

1) inserting 1000 insert queries 1 one (for every record)

2) insert

insert table name ('field1', 'field2') values (value,value),(value,value),(value,value),(value,value) 

i want second 1 perform faster , useful.

according mysql insert plan have following issues time spend on:

- connecting - sending query server - parsing query  - inserting row (1 × size of row) - inserting indexes: (1 × number of indexes) - closing 

due this, multiple insert more faster since produce connecting, sending query server, parsing query, closing overheads once. , shown in manual too:


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -