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 ¶
- type Hooks
- func (Hooks) ApplyForSort(_ planplugin.PlanBuilder, _ *planplugin.VectorSortContext, ...) (int32, bool, error)
- func (Hooks) BuildFullTextIndexDefs(ctx planplugin.CompilerContext, indexInfo *tree.FullTextIndex, ...) ([]*plan.IndexDef, []*plan.TableDef, error)
- func (Hooks) BuildSecondaryIndexDefs(_ planplugin.CompilerContext, _ *tree.Index, _ map[string]*plan.ColDef, ...) ([]*plan.IndexDef, []*plan.TableDef, error)
- func (Hooks) CanApply(_ planplugin.PlanBuilder, _ *planplugin.VectorSortContext, ...) (bool, 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/plan.Hooks for fulltext indexes.
func (Hooks) ApplyForSort ¶
func (Hooks) ApplyForSort(_ planplugin.PlanBuilder, _ *planplugin.VectorSortContext, _ *planplugin.MultiTableIndexRef, nodeID int32, _ planplugin.ApplyForSortOpts) (int32, bool, error)
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 ¶
func (Hooks) CanApply(_ planplugin.PlanBuilder, _ *planplugin.VectorSortContext, _ *planplugin.MultiTableIndexRef) (bool, error)
CanApply — fulltext has no ANN-style ORDER BY rewrite; report inapplicable.