idxcron

package
v0.0.0-debug-20260702 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL