Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add doc for aggregate functions. #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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