Skip to content

Commit

Permalink
docs: add doc for aggregate functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
my-vegetable-has-exploded committed May 6, 2024
1 parent 6198383 commit 86cf796
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
26 changes: 16 additions & 10 deletions src/reference/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,19 @@ Here is the schema provided by `pgvecto.rs`.

## List of functions

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



## List of casts

Expand Down Expand Up @@ -116,9 +122,9 @@ Here is the schema provided by `pgvecto.rs`.
| vectors | vecf16_cos_ops | vecf16 |
| vectors | vecf16_dot_ops | vecf16 |
| vectors | vecf16_l2_ops | vecf16 |
| vectors | veci8_cos_ops | veci8 |
| vectors | veci8_dot_ops | veci8 |
| vectors | veci8_l2_ops | veci8 |
| vectors | veci8_cos_ops | veci8 |
| vectors | veci8_dot_ops | veci8 |
| vectors | veci8_l2_ops | veci8 |
| vectors | svector_cos_ops | svector |
| vectors | svector_dot_ops | svector |
| vectors | svector_l2_ops | svector |
Expand Down
2 changes: 1 addition & 1 deletion src/usage/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Skip lists are constructed using a probabilistic approach, where nodes become le

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.

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.
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.

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.

Expand Down

0 comments on commit 86cf796

Please sign in to comment.