How do I choose the right composite index column order in PostgreSQL?
Build one (user_id, status, created_at DESC) index with equality columns first and the sort column last, then drop the single-column indexes it now covers.
Just Ask
Ask me anything about software architecture, careers, PHP, Go and the craft of building software; I answer here, in the open, for everyone. (Page 7/8)
Whatever's on your mind, don't hold back. Questions reach me directly; I answer the good ones and publish them on this page. Your email is never published.
Build one (user_id, status, created_at DESC) index with equality columns first and the sort column last, then drop the single-column indexes it now covers.
A single-flight lock plus TTL jitter covers most cases; reach for XFetch only when recompute is truly expensive, and add stale-while-revalidate either way.
The enemy behind the pauses is allocation rate: kill the top allocator with pprof, pool the hot path with sync.Pool, and tune GOGC last, not first.
Plot the memory_get_usage curve first, bisect service providers to narrow the culprit, then reset stateful singletons in Octane's hooks and clear statics.
Database-per-tenant does not scale operationally at 10k; keep tenant_id on every table and bury isolation in Postgres Row-Level Security instead.
Verify the HMAC constant-time over the raw body, return 200 fast and enqueue the work, and let a UNIQUE constraint on event_id enforce once-only.
Shift payments at the gateway by 5/20/100 and validate in shadow first; the real work is splitting the tables, behind an anti-corruption layer and outbox.
The moment a price changes, write through to KV or purge the key in the same transaction or outbox; a short TTL and versioned keys are only the safety net.
Standardize on W3C Trace Context, leave propagation to the OTel SDK, and put traceparent in the queue message header, since that is where the chain snaps.
This is an addressing-plan problem, not a routing bug: pin Docker's pool in daemon.json, cut AllowedIPs down to the DB subnet, make routes persistent.