Drop three route indexes no statement reads (#236)

* perf(db): drop three route indexes no statement reads

* docs(db): reword the retention residual comment
This commit is contained in:
MrAlders0n authored and GitHub committed 2026-10-19 05:46:20 -04:00
1 parent 8e0fd4b535
commit c8595424e9
9 files changed
+41 -5

No files matched your search

+2 -1
View File
@@ -29,7 +29,8 @@ type Querier interface {
DeleteChannelMembersNotIn(ctx context.Context, arg DeleteChannelMembersNotInParams) error
// One batch past retention, keyset after the per-run cursor (the first call passes -infinity, 0).
// The truncated bound (ms ceiling of the cutoff) drives idx_known_routes_keyset; the exact
// residual decides membership. + interval 0 keeps it off idx_known_routes_last_seen.
// residual decides membership. + interval 0 keeps the exact cutoff a Filter, so the planner
// cannot switch to a last_seen index on deployments that still have one.
DeleteExpiredRoutes(ctx context.Context, arg DeleteExpiredRoutesParams) (DeleteExpiredRoutesRow, error)
// One batch of rarely-seen routes after the cursor, inside a window of at most 6 h below the grace
// cutoff: candidates without locks, then lock SKIP LOCKED through the pkey (re-checked on the newest
+2 -1
View File
@@ -195,7 +195,8 @@ type DeleteExpiredRoutesRow struct {
// One batch past retention, keyset after the per-run cursor (the first call passes -infinity, 0).
// The truncated bound (ms ceiling of the cutoff) drives idx_known_routes_keyset; the exact
// residual decides membership. + interval 0 keeps it off idx_known_routes_last_seen.
// residual decides membership. + interval 0 keeps the exact cutoff a Filter, so the planner
// cannot switch to a last_seen index on deployments that still have one.
func (q *Queries) DeleteExpiredRoutes(ctx context.Context, arg DeleteExpiredRoutesParams) (DeleteExpiredRoutesRow, error) {
row := q.db.QueryRow(ctx, deleteExpiredRoutes,
arg.AfterTs,