Bulk Operations — COPY, INSERT...SELECT, and Efficient Batch Processing
Bulk Operations — COPY, INSERT...SELECT, and Efficient Batch Processing
Row-by-row inserts, updates, and deletes are the slowest possible way to move data in PostgreSQL. A loop that inserts 100,000 rows one at a time can take minutes; the equivalent COPY command takes seconds. This lesson covers the tools PostgreSQL provides for high-throughput data operations.