Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我即将插入365条插入记录,我想知道哪个会更好。
1)一个一个插入1000个插入查询(对于每条记录)
2)插入喜欢
insert into table name ('field1', 'field2') values (value,value),(value,value),(value,value),(value,value)
我想让第二个执行得更快,它会有用吗?
创建批处理和插入数据会更好,因为不会为每个 INSERT 语句命中数据库(如果每个记录都是单独插入的)。