Should I use a partial index on a queue table where I only ever scan 'pending' rows?
Build the partial index on `WHERE status='pending'`, include the `ORDER BY` column, pair it with `FOR UPDATE SKIP LOCKED`, and pass 'pending' literally.
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 2/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 the partial index on `WHERE status='pending'`, include the `ORDER BY` column, pair it with `FOR UPDATE SKIP LOCKED`, and pass 'pending' literally.
Cancellation propagates only if you pass `r.Context()` into every downstream call, leave no `context.Background()` in the chain, and use `WithoutCancel`.
Integer cents in the DB, an immutable `Money` on the model: put the mapping in one `CastsAttributes` class and keep currency as a second column there.
Default to `list<Order>` docblocks with strict PHPStan in CI; add one generic `Collection<T>` for behavior, a concrete class only at a trust boundary.
Turn the promotion into a concrete move: pick one fuzzy problem nobody owns and carry it end to end for a quarter, from its definition to its rollout.
Log at ERROR when the line would wake someone at 3am and at WARN when it would not, log a failure once at its boundary, and alert on the ERROR rate.
Define readiness, liveness and startup as Kubernetes probes; keep HEALTHCHECK only if the image also runs under Compose, pointing both at one endpoint.
Instrument usage per partner, publish a dated sunset with Sunset and Deprecation headers on every response, run brownouts, and cut when usage nears zero.
Run EXPLAIN (ANALYZE, BUFFERS) in production, then ANALYZE the table and check n_dead_tup; tune autovacuum per-table for sessions and add a partial index.
Export NumGoroutine() as a metric, take a pprof goroutine dump at peak, make the spawn site behind the parked stacks honor ctx.Done(), then add goleak.