fix: make send_batch set-based#159
Conversation
REV Code Review Report
BLOCKING ISSUES (8)HIGH
HIGH
MEDIUM
MEDIUM
MEDIUM
MEDIUM
MEDIUM
MEDIUM
NON-BLOCKING (2)LOW
LOW
POTENTIAL ISSUES (2)LOW
LOW
Summary
REV-assisted review (AI analysis by postgres-ai/rev) |
db946b4 to
238e79d
Compare
REV Code Review Report
BLOCKING ISSUES (8)HIGH
HIGH
HIGH
HIGH
MEDIUM
MEDIUM
MEDIUM
MEDIUM
NON-BLOCKING (4)LOW
LOW
LOW
LOW
POTENTIAL ISSUES (6)MEDIUM
MEDIUM
LOW
LOW
LOW
LOW
Summary
REV-assisted review (AI analysis by postgres-ai/rev) |
REV Code Review Report
BLOCKING ISSUES (10)CRITICAL
CRITICAL
HIGH
HIGH
HIGH
HIGH
HIGH
MEDIUM
MEDIUM
MEDIUM
NON-BLOCKING (3)MEDIUM
LOW
LOW
POTENTIAL ISSUES (5)HIGH
HIGH
MEDIUM
MEDIUM
LOW
Summary
REV-assisted review (AI analysis by postgres-ai/rev) |
REV Code Review Report
BLOCKING ISSUES (8)HIGH
HIGH
HIGH
HIGH
HIGH
HIGH
MEDIUM
MEDIUM
NON-BLOCKING (3)MEDIUM
LOW
MEDIUM
POTENTIAL ISSUES (5)MEDIUM
MEDIUM
MEDIUM
LOW
LOW
Summary
REV-assisted review (AI analysis by postgres-ai/rev) |
9420b4c to
9c9c1a5
Compare
Testing evidence for PR #159Head: CI:
Local validation:
Review:
Verdict: ready for maintainer approval/merge. Not merging without explicit approval. |
Final testing evidence for PR #159Head: CI:
Local validation:
Review:
Verdict: ready for maintainer approval/merge. Not merging without explicit approval. |
Summary
Replace
pgque.send_batch()'s PL/pgSQL per-payload loop overpgque.insert_event()with set-based inserts into the current queue event table.This makes batching real on the server side:
nextval(...)set-wise;insert into ... select from unnest(...);jsonb::text) and text fast-path semantics;Why
Before this PR,
send_batch()reduced client round-trips but still did N internal calls toinsert_event(), so it could become the producer bottleneck.Tests
RED/GREEN added to
tests/test_api_send.sql:FOREACHor callpgque.insert_event(...);Local gates run: