Documentation
¶
Overview ¶
Package compile implements the IVF-FLAT plugin's compile-layer (DDL) hooks.
Lifted from:
- pkg/sql/compile/ddl.go:2348 handleVectorIvfFlatIndex
- pkg/sql/compile/ddl_index_algo.go:199 handleIndexColCount
- pkg/sql/compile/ddl_index_algo.go:221 handleIvfIndexMetaTable
- pkg/sql/compile/ddl_index_algo.go:253 handleIvfIndexCentroidsTable
- pkg/sql/compile/ddl_index_algo.go:412 handleIvfIndexEntriesTable
- pkg/sql/compile/ddl_index_algo.go:507 handleIvfIndexRegisterUpdate
- pkg/sql/compile/ddl_index_algo.go:531 logTimestamp
- pkg/sql/compile/ddl_index_algo.go:575 handleIvfIndexDeleteOldEntries
- pkg/sql/compile/iscp_util.go:267 getIvfflatMetadata
Index ¶
- type Hooks
- func (h Hooks) HandleCreateIndex(ctx compileplugin.CompileContext, indexDefs map[string]*plan.IndexDef) error
- func (Hooks) HandleDropIndex(_ compileplugin.CompileContext, defs map[string]*plan.IndexDef) error
- func (h Hooks) HandleReindex(ctx compileplugin.CompileContext, indexDefs map[string]*plan.IndexDef, ...) error
- func (Hooks) IdxcronMetadata(ctx compileplugin.CompileContext) ([]byte, error)
- func (Hooks) RestoreInitSQL(ctx compileplugin.CompileContext, indexDefs map[string]*plan.IndexDef) (bool, string, error)
- func (Hooks) ValidateReindexParams(old map[string]string, alter compileplugin.ReindexParamUpdate) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct{}
Hooks implements plugin/compile.Hooks for IVF-FLAT.
func (Hooks) HandleCreateIndex ¶
func (h Hooks) HandleCreateIndex(ctx compileplugin.CompileContext, indexDefs map[string]*plan.IndexDef) error
HandleCreateIndex is lifted verbatim from Scope.handleVectorIvfFlatIndex (pkg/sql/compile/ddl.go:2348). HandleReindex routes through the same body with forceSync threaded.
func (Hooks) HandleDropIndex ¶
func (Hooks) HandleDropIndex(_ compileplugin.CompileContext, defs map[string]*plan.IndexDef) error
HandleDropIndex: IVF-FLAT generic hidden-table deletion is performed by the SQL layer; CDC tasks and idxcron registrations are torn down via DropAllIndexCdcTasks / DropAllIndexUpdateTasks at the same seam (pkg/sql/compile/ddl.go DropIndex path). No additional cleanup here.
func (Hooks) HandleReindex ¶
func (h Hooks) HandleReindex(ctx compileplugin.CompileContext, indexDefs map[string]*plan.IndexDef, forceSync bool) error
HandleReindex runs the same body as HandleCreateIndex with forceSync threaded into centroid building. Matches ddl.go:980-987 dispatch.
func (Hooks) IdxcronMetadata ¶
func (Hooks) IdxcronMetadata(ctx compileplugin.CompileContext) ([]byte, error)
IdxcronMetadata delegates to the shared declarative helper. The previous getIvfflatMetadata function (with its bespoke resolve+marshal loop) is replaced by this 3-line spec declaration.
func (Hooks) RestoreInitSQL ¶
func (Hooks) RestoreInitSQL(ctx compileplugin.CompileContext, indexDefs map[string]*plan.IndexDef) (bool, string, error)
RestoreInitSQL — see CAGRA. Rebuilds the IVF-FLAT index post-commit during restore (re-derives entries against the restored centroids).
func (Hooks) ValidateReindexParams ¶
func (Hooks) ValidateReindexParams(old map[string]string, alter compileplugin.ReindexParamUpdate) (map[string]string, error)
ValidateReindexParams handles the IVF-FLAT `lists` update at ALTER REINDEX time. The legacy switch at ddl.go:928 wrote new lists into the AlgoParams map and persisted it via UPDATE mo_catalog.mo_indexes inline — that persistence stays at the SQL-layer call site, so this hook only performs the map merge.