Documentation
¶
Index ¶
- Variables
- func ErrorText(t T) redact.SafeString
- type T
- func (t T) AllowsPrefixColumns() bool
- func (t T) CanBePrimary() bool
- func (t T) CanBeUnique() bool
- func (T) EnumDescriptor() ([]byte, []int)
- func (t T) HasLinearOrdering() bool
- func (x T) String() string
- func (t T) SupportsOpClass() bool
- func (t T) SupportsSharding() bool
- func (t T) SupportsStoring() bool
Constants ¶
This section is empty.
Variables ¶
var T_name = map[int32]string{
0: "FORWARD",
1: "INVERTED",
2: "VECTOR",
}
var T_value = map[string]int32{
"FORWARD": 0,
"INVERTED": 1,
"VECTOR": 2,
}
Functions ¶
func ErrorText ¶
func ErrorText(t T) redact.SafeString
ErrorText describes the type of the index using the phrase "an inverted index" or "a vector index". This is intended to be included in errors that apply to multiple index types.
Types ¶
type T ¶
type T int32
T represents different types of indexes that can be defined on a table.
const ( // FORWARD is a standard relational index, containing at most one entry for // each row in the table (if a partial index, a table row may not have a // corresponding entry in the index). FORWARD T = 0 // INVERTED indexes can contain multiple entries for each row in the table, // which is useful for indexing collection or composite data types like JSONB, // ARRAY, and GEOGRAPHY. INVERTED T = 1 // VECTOR indexes high-dimensional vectors to enable rapid similarity search // using an approximate nearest neighbor (ANN) algorithm. VECTOR T = 2 )
func (T) AllowsPrefixColumns ¶
AllowsPrefixColumns is true if this index type allows other columns from the table to act as a key prefix that separates indexed values into distinct groupings, e.g. by user or customer.
func (T) CanBePrimary ¶
CanBePrimary is true if this index type can be the primary index that always contains unique keys sorted according to the primary ordering of the table. Secondary indexes refer to rows in the primary index by unique key value.
func (T) CanBeUnique ¶
CanBeUnique is true if this index type can be declared as UNIQUE, meaning it never contains duplicate keys.
func (T) EnumDescriptor ¶
func (T) HasLinearOrdering ¶
HasLinearOrdering is true if this index type does not define a linear ordering on the last key column in the index. For example, a vector index groups nearby vectors, but does not define a linear ordering among them. As another example, an inverted index only defines a linear ordering for tokens, not for the original JSONB or ARRAY data type.
func (T) SupportsOpClass ¶
SupportsOpClass is true if this index type allows columns to specify an operator class, which defines an alternate set of operators used when sorting and querying those columns.
NOTE: Currently, only inverted and vector indexes support operator classes, and only on the last column of the index.
func (T) SupportsSharding ¶
SupportsSharding is true if this index type can be hash sharded, meaning that its rows are grouped according to a hash value and spread across the keyspace.
func (T) SupportsStoring ¶
SupportsStoring is true if this index type allows STORING values, which are un-indexed columns from the table that are stored directly in the index for faster retrieval.