plan

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: 9 Imported by: 0

Documentation

Overview

Package plan implements the fulltext plugin's plan-layer hooks.

Fulltext uses a parallel hook BuildFullTextIndexDefs (taking *tree.FullTextIndex) instead of BuildSecondaryIndexDefs (which takes *tree.Index, the vector-index parse-tree shape). The vector plugins stub BuildFullTextIndexDefs; the fulltext plugin stubs BuildSecondaryIndexDefs; the SQL-layer dispatch picks the right hook by parse-tree type.

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/plan.Hooks for fulltext indexes.

func (Hooks) ApplyForSort

ApplyForSort — same, never applies; passthrough.

func (Hooks) BuildFullTextIndexDefs

func (Hooks) BuildFullTextIndexDefs(
	ctx planplugin.CompilerContext,
	indexInfo *tree.FullTextIndex,
	colMap map[string]*plan.ColDef,
	existedIndexes []*plan.IndexDef,
	pkeyName string,
) ([]*plan.IndexDef, []*plan.TableDef, error)

BuildFullTextIndexDefs constructs the IndexDef + TableDef for one fulltext index. Lifted from pkg/sql/plan/build_ddl.go::buildFullTextIndexTable, but per-index (the legacy function batched a slice; the plan-layer caller now loops and dispatches per-info).

Hidden-table schema: (doc_id, pos, word, __mo_pk_rowid) clustered by word.

func (Hooks) BuildSecondaryIndexDefs

func (Hooks) BuildSecondaryIndexDefs(
	_ planplugin.CompilerContext,
	_ *tree.Index,
	_ map[string]*plan.ColDef,
	_ []*plan.IndexDef,
	_ string,
) ([]*plan.IndexDef, []*plan.TableDef, error)

BuildSecondaryIndexDefs is unreachable for fulltext — the plan-build dispatch routes *tree.Index parse trees to the vector plugins. Fulltext receives its parse tree via BuildFullTextIndexDefs.

func (Hooks) CanApply

CanApply — fulltext has no ANN-style ORDER BY rewrite; report inapplicable.

Jump to

Keyboard shortcuts

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