Databases · Middle · Question 44 of 75
How do you insert 10,000 rows efficiently?
- 1Disable all constraints permanently
- 2Insert them one by one, each in its own transaction
- ✓Correct answer: Use a multi-row
INSERT ... VALUES (...), (...)orCOPYin one transaction, not 10,000 separate autocommitted inserts
Explanation
Each autocommit waits for a disk flush, and each statement costs a round trip. Batching cuts both.