mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 16:16:56 +08:00
Updated readme [skip ci]
This commit is contained in:
@@ -78,12 +78,18 @@ SELECT * FROM items WHERE embedding <-> '[3,1,2]' < 5;
|
|||||||
|
|
||||||
Note: Combine with `ORDER BY` and `LIMIT` to use an index
|
Note: Combine with `ORDER BY` and `LIMIT` to use an index
|
||||||
|
|
||||||
Get the average of vectors
|
Average vectors
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT AVG(embedding) FROM items;
|
SELECT AVG(embedding) FROM items;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Average groups of vectors
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT category_id, AVG(embedding) FROM items GROUP BY category_id;
|
||||||
|
```
|
||||||
|
|
||||||
## Indexing
|
## Indexing
|
||||||
|
|
||||||
Speed up queries with an approximate index. Add an index for each distance function you want to use.
|
Speed up queries with an approximate index. Add an index for each distance function you want to use.
|
||||||
|
|||||||
Reference in New Issue
Block a user