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 Cagra plugin's plan-layer hooks. Phase 6 split: bodies live in pkg/sql/plan; this file is thin redirects. See pkg/vectorindex/hnsw/plugin/plan/plan.go for the canonical template.

Index

Constants

View Source
const (
	CAGRACreateFuncName = "cagra_create"
	CAGRASearchFuncName = "cagra_search"
)

Variables

View Source
var (
	CAGRASearchColDefs = []*plan.ColDef{
		{
			Name: "pkid",
			Typ: plan.Type{
				Id:          int32(types.T_int64),
				NotNullable: false,
				Width:       8,
			},
		},
		{
			Name: "score",
			Typ: plan.Type{
				Id:          int32(types.T_float64),
				NotNullable: false,
				Width:       8,
			},
		},
	}
)

Functions

This section is empty.

Types

type Hooks

type Hooks struct{}

func (Hooks) BuildFullTextIndexDefs

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

BuildFullTextIndexDefs is unreachable for cagra — the plan-build dispatch only routes *tree.FullTextIndex parse trees to the fulltext plugin. Returning an error here makes any misrouting visible.

func (Hooks) BuildSecondaryIndexDefs

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

BuildSecondaryIndexDefs constructs the IndexDef + TableDef pair for the two hidden tables CAGRA requires (metadata + storage). Lifted from pkg/sql/plan/build_ddl.go:3147 (buildCagraSecondaryIndexDef, now deleted).

Jump to

Keyboard shortcuts

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