perf(postgres): implement batch insert in dataWriter (#1252) - #3096
perf(postgres): implement batch insert in dataWriter (#1252)#3096gcoinstash-cmd wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughRelationship and attribute inserts now build multi-row SQL statements in chunks of up to 500 records. Empty inputs return without queuing work. Existing normalization, conflict handling, serialization, and error propagation remain in place. ChangesPostgres batch inserts
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR changes PostgreSQL writes to use parameterized multi-row inserts with batching; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I have read the CLA Document and I hereby sign the CLA |
|
I have read the CLA Document and I hereby sign the CLA |
Fixes #1252
/claim #1252
Summary
Optimizes Postgres
data_writer.goby replacing single-row loop inserts with parameterized multi-row batch inserts chunked in groups of 500 records forbatchInsertRelationshipsandbatchInsertAttributes.Changes
internal/storage/postgres/data_writer.go: RefactoredbatchInsertRelationshipsandbatchInsertAttributesto construct parameterized multi-rowINSERT INTO ... VALUES (...), (...)statements with chunking (500 records per batch) to respect Postgres parameter limits and optimize write throughput.gofmtand static analysis withgo vet.Summary by CodeRabbit