compile

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: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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.

Jump to

Keyboard shortcuts

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