Documentation
¶
Overview ¶
Package idxcron is IVF-FLAT's idxcron hook implementation. It owns the lists / nsample heuristic that the executor used to host on (*IndexUpdateTaskInfo).checkIndexUpdatable, plus the kmeans_train_percent runtime adjustment that mutates task metadata.
Decision tree mirrors the IVF-FLAT folklore (Faiss "30*nlist to 256*nlist training samples"):
- dsize < nlist : skip (k-means can't form centroids with fewer points than clusters)
- nsample < 30*nlist : always reindex
- 30*nlist <= nsample < 256*nlist : reindex every interval
- nsample >= 256*nlist : reindex every 2*interval, AND clamp kmeans_train_percent to 256*nlist / dsize
nsample = dsize * (kmeans_train_percent / 100), pulled from the task's persisted metadata blob.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RunGetCountSql = sqlexec.RunSql
RunGetCountSql is the SELECT used to count source-table rows. Stubbed as a package-level var so tests can replace it.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct{}
func (Hooks) Updatable ¶
func (Hooks) Updatable(in idxcronplugin.UpdatableInput) (ok bool, reason string, err error)
Updatable runs the IVF-FLAT-specific rebuild gate. The executor has already enforced auto_update on, currentHour matches, and createdAt + interval elapsed; everything below is IVF-FLAT-owned.