Skip to content

Commit 8bdeaed

Browse files
docs: add doc for aggregate functions.
Signed-off-by: my-vegetable-has-exploded <[email protected]>
1 parent 6198383 commit 8bdeaed

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/reference/schema.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,19 @@ Here is the schema provided by `pgvecto.rs`.
7777

7878
## List of functions
7979

80-
| Name | Argument type | Result type | Description |
81-
| ------------------ | ------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------- |
82-
| pgvectors_upgrade | | void | Administration function for upgrading `pgvecto.rs`. |
83-
| to_svector | dims integer, index integer[], value real[] | svector | Construct a sparse vector from two arrays of indexes and values |
84-
| binarize | vector vector | bvector | Binarize a vector. All positive elements are set to 1, otherwise 0. |
85-
| text2vec_openai | input text, model text | vector | Embedding function for OpenAI embeddings API. |
86-
| text2vec_openai_v3 | input text | vector | Embedding function for OpenAI embeddings API. The model is set to `text-embedding-3-small`. |
80+
| Name | Argument type | Result type | Description |
81+
| ------------------ | ------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
82+
| pgvectors_upgrade | | void | Administration function for upgrading `pgvecto.rs`. |
83+
| to_svector | dims integer, index integer[], value real[] | svector | Construct a sparse vector from two arrays of indexes and values |
84+
| binarize | vector vector | bvector | Binarize a vector. All positive elements are set to 1, otherwise 0. |
85+
| text2vec_openai | input text, model text | vector | Embedding function for OpenAI embeddings API. |
86+
| text2vec_openai_v3 | input text | vector | Embedding function for OpenAI embeddings API. The model is set to `text-embedding-3-small`. |
87+
| vector_dims | vector | integer | Get the dimension of given vector. |
88+
| vector_norm | vector | real | Calculates the Euclidean norm of a given vector. |
89+
| avg | vector[] | vector | Aggregate Function. Calculates the average of given vectors. $Result[j] = \frac{\sum_{i \in 1..n}{vec[i][j]}}{n}$ |
90+
| sum | vector[] | vector | Aggregate Function. Calculates the sum of given vectors. $Result[j] = \sum_{i \in 1..n}{vec[i][j]}$ |
91+
92+
8793

8894
## List of casts
8995

@@ -116,9 +122,9 @@ Here is the schema provided by `pgvecto.rs`.
116122
| vectors | vecf16_cos_ops | vecf16 |
117123
| vectors | vecf16_dot_ops | vecf16 |
118124
| vectors | vecf16_l2_ops | vecf16 |
119-
| vectors | veci8_cos_ops | veci8 |
120-
| vectors | veci8_dot_ops | veci8 |
121-
| vectors | veci8_l2_ops | veci8 |
125+
| vectors | veci8_cos_ops | veci8 |
126+
| vectors | veci8_dot_ops | veci8 |
127+
| vectors | veci8_l2_ops | veci8 |
122128
| vectors | svector_cos_ops | svector |
123129
| vectors | svector_dot_ops | svector |
124130
| vectors | svector_l2_ops | svector |

src/usage/indexing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Skip lists are constructed using a probabilistic approach, where nodes become le
138138

139139
Constructing this multi-layered graph begins with a foundational layer that encapsulates the entire dataset. Moving up the hierarchy, each successive layer provides a streamlined summary of its predecessor, featuring fewer nodes and functioning as fast tracks for making broader leaps within the graph.
140140

141-
Smaller [`m`](/reference/indexing_options.html#options-for-table-hnsw)) values are better for lower-dimensional data or when you require lower recall. Larger `m` values are useful for higher-dimensional data or when high recall is important.
141+
Smaller [`m`](/reference/indexing_options.html#options-for-table-hnsw) values are better for lower-dimensional data or when you require lower recall. Larger `m` values are useful for higher-dimensional data or when high recall is important.
142142

143143
The [`ef_construction`](/reference/indexing_options.html#options-for-table-hnsw) parameter determines the dynamic candidate list size when adding new nodes; increasing this value may enhance recall but could extend index construction time.
144144

0 commit comments

Comments
 (0)