Documentation
¶
Overview ¶
Package idxcron carries the shared cuvs idxcron Updatable body.
Lives one directory away from pkg/vectorindex/idxcron (the cron consumer/executor) to avoid a test-only import cycle on the GPU tag: pkg/vectorindex/idxcron tests pull in pkg/sql/plan via testengine, pkg/sql/plan pulls in pkg/indexplugin/all, and on the GPU tag that pulls in pkg/vectorindex/cagra/plugin/idxcron which needs the shared helper. Putting the helper in a separate package breaks the cycle.
Index ¶
Constants ¶
const MaxOverflowSize = 200_000
MaxOverflowSize is the brute-force overflow ceiling. Once the per-cron-tick count exceeds this, the gate fires regardless of the per-algo minimum threshold (lists / intermediate_graph_degree).
Sizing rationale: GPU brute-force (cuvs.GpuBruteForce, fp32, D≈768 on A100/L40S) stays comfortably under 5ms per query at 200K vectors, then grows roughly linearly with overflow size. 200K keeps brute-force latency well inside typical search SLAs while still letting the GPU absorb a meaningful amount of CDC traffic between rebuilds. Safe across all reasonable GPU targets including older cards (T4/V100) and higher embedding dimensions.
Note: the cadence gate (createdAt+interval check above) is the operator's contract and is still honored — the safety cap only overrides the per-algo threshold, not the cadence. Hardcoded because there's no algo-specific reason to differ today; lift to a spec field if that changes.
Variables ¶
This section is empty.
Functions ¶
func CuvsUpdatable ¶
func CuvsUpdatable( in idxcronplugin.UpdatableInput, spec CuvsUpdatableSpec, ) (ok bool, reason string, err error)
Types ¶
type CuvsUpdatableSpec ¶
type CuvsUpdatableSpec struct {
// StorageTableType is the IndexAlgoTableType holding the tag=1
// CDC event log (catalog.Cagra_TblType_Storage /
// catalog.Ivfpq_TblType_Storage).
StorageTableType string
// ThresholdParam is the indexAlgoParams key whose int64 value
// sets the minimum delta-record count needed before the
// cron-triggered rebuild fires. For CAGRA:
// catalog.IntermediateGraphDegree; for IVF-PQ:
// catalog.IndexAlgoParamLists.
ThresholdParam string
// MinSizeDefault is the cuvs library default for ThresholdParam,
// applied as a min-size floor when indexAlgoParams[ThresholdParam]
// is 0/missing. CAGRA: 128 (cuvs.DefaultCagraBuildParams().
// IntermediateGraphDegree). IVF-PQ: 1024 (cuvs.DefaultIvfPqBuildParams().
// NLists). The min-size check is the load-bearing gate — even if
// the user didn't specify a build param, the rebuild needs at
// least the cuvs default count of records to produce a usable
// index.
MinSizeDefault int64
}
CuvsUpdatableSpec carries the per-algorithm configuration the shared CuvsUpdatable body needs. Struct (not positional args) so future knobs can be added without churning every call site — e.g. an absolute MinRecordCount floor, a ThresholdMultiplier, alternate CountStrategy (records vs chunks vs bytes), etc.