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 個の挿入クエリを 1 つずつ挿入する (レコードごとに)
2) のように挿入
insert into table name ('field1', 'field2') values (value,value),(value,value),(value,value),(value,value)
私は2番目のものをより速く実行したいのですが、それは役に立ちますか.
バッチを作成してデータを挿入する方が、INSERT ステートメントごとにデータベースがヒットするわけではないため (各レコードが個別に挿入される場合)、より適切になります。