perf: batch server case imports within native limits - #13
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe importers now use ChangesBounded case-row import
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The bounded import implementation has no substantiated merge-blocking issue at the current head. Sequence Diagram(s)sequenceDiagram
participant Importer
participant PreparedCaseBatch
participant PDO
Importer->>PreparedCaseBatch: provide validated caseRows
PreparedCaseBatch->>PDO: prepare bounded INSERT statement
PreparedCaseBatch->>PDO: execute batched parameters
PDO-->>Importer: return success or batch failure
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Phase 4 of the approved integrity/performance plan: replace per-row server case INSERTs with bounded prepared multirow batches. No public API, dependencies, configuration, catalogue/schema batching, or user steps change.
Tests and reviews
04f2530: six targeted failures on the base (single-row executions and missing second-batch prepare/full-batch rollback behavior); broader focused run had 24 intended failures and five singleton-preservation passes.6a753ce: production only; tests unchanged after RED.composer check: 600 tests, 9,824 assertions, 112 service/environment skips; validation, lint, style, PHPStan pass.max_allowed_packet=262144: six escaped-string cases passed; observed[6,6,1]batches for 10,000-byte text, singleton batches for valid 65,000/65,520-byte text.Measured complete-import performance
Same fixed 10,000-row uncompressed SAV, actual
SpssAdapter::import/installed engine, four mixed numeric/text columns, same isolated servers/runtime/dependencies, ready empty catalogue. One warmup + five measured imports per workload/revision; nearby baseline repeat and two AFTER runs. Every ordered scalar checked using NULL tags, exact text and binary64 bits.Case executes: 10,000 → 40. Total SQL execution PDO API calls: PostgreSQL 10,132 → 172, MySQL 10,101 → 142 (excludes two unchanged transaction calls; not wire-command counts). Prepare API calls increase by one for the tail shape. Actual versions: PHP 8.5.9, MySQL 8.4.9, PostgreSQL 17.11; local pgsql extension 8.5.10/libpq 16.15 held identical across revisions.
Limits: dedicated loopback containers use tmpfs and a shared host, so this is not a production SLA. Tiny 1/2-row follow-ups showed no reproducible regression but do not prove formal equivalence. SAV byte checksum:
b2e921455d9d6bc129148e89731602d35d6f7d6ec70a654968b5a572e7f65d37. Benchmark harness/results remain outside the product repository; no persistent benchmark framework or dataset snapshots added. Existing installed writer compression=1 precision observation recorded separately, outside this batching change; fixed uncompressed fixtures verified exactly.Next phase
After user merge: Phase 5, grouped PHP export metadata reads to remove N+1 queries without a new cache/layer. The overall plan is not complete. Do not auto-merge.